Home | History | Annotate | Download | only in tsan
      1 /* Copyright (c) 2008-2010, Google Inc.
      2  * All rights reserved.
      3  *
      4  * Redistribution and use in source and binary forms, with or without
      5  * modification, are permitted provided that the following conditions are
      6  * met:
      7  *
      8  *     * Redistributions of source code must retain the above copyright
      9  * notice, this list of conditions and the following disclaimer.
     10  *     * Neither the name of Google Inc. nor the names of its
     11  * contributors may be used to endorse or promote products derived from
     12  * this software without specific prior written permission.
     13  *
     14  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     15  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     16  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     17  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     18  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     19  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     20  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     21  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     22  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     24  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     25  *
     26  * ---
     27  * Author: Kostya Serebryany
     28  */
     29 
     30 /* This file lists ThreadSanitizer/Valgrind client requests.
     31    See ts_valgrind.cc for details.
     32    This file may need to be included into source files
     33    outside of ThreadSanitizer, hence the BSD license.
     34 */
     35 
     36 #ifndef TS_VALGRIND_CLIENT_REQUESTS_H_
     37 #define TS_VALGRIND_CLIENT_REQUESTS_H_
     38 
     39 #include "valgrind.h"
     40 
     41 /*
     42  * WARNING: The following enum defines the ThreadSanitizer ABI.
     43  * Existing elements should never be changed, new elements should be added to
     44  * the end.
     45  */
     46 enum {
     47   TSREQ_NOOP = VG_USERREQ_TOOL_BASE('T', 'S'),
     48   TSREQ_CLEAN_MEMORY,
     49   TSREQ_MAIN_IN,
     50   TSREQ_MAIN_OUT,
     51   TSREQ_MALLOC,
     52   TSREQ_FREE,
     53   TSREQ_MMAP,
     54   TSREQ_MUNMAP,
     55   TSREQ_BENIGN_RACE,
     56   TSREQ_EXPECT_RACE,
     57   TSREQ_PCQ_CREATE,
     58   TSREQ_PCQ_DESTROY,
     59   TSREQ_PCQ_PUT,
     60   TSREQ_PCQ_GET,
     61   TSREQ_TRACE_MEM,
     62   TSREQ_MUTEX_IS_USED_AS_CONDVAR,
     63   TSREQ_IGNORE_READS_BEGIN,
     64   TSREQ_IGNORE_READS_END,
     65   TSREQ_IGNORE_WRITES_BEGIN,
     66   TSREQ_IGNORE_WRITES_END,
     67   TSREQ_SET_THREAD_NAME,
     68   TSREQ_IGNORE_ALL_ACCESSES_BEGIN,
     69   TSREQ_IGNORE_ALL_ACCESSES_END,
     70   TSREQ_IGNORE_ALL_SYNC_BEGIN,
     71   TSREQ_IGNORE_ALL_SYNC_END,
     72   TSREQ_GLOBAL_IGNORE_ON,
     73   TSREQ_GLOBAL_IGNORE_OFF,
     74   TSREQ_PUBLISH_MEMORY_RANGE,
     75   TSREQ_UNPUBLISH_MEMORY_RANGE,
     76   TSREQ_PRINT_MEMORY_USAGE,
     77   TSREQ_PRINT_STATS,
     78   TSREQ_RESET_STATS,
     79   TSREQ_SET_MY_PTHREAD_T,
     80   TSREQ_THR_STACK_TOP,
     81   TSREQ_SET_STACKTOP_STACKSIZE,
     82   TSREQ_PTH_API_ERROR,
     83   TSREQ_PTHREAD_JOIN_POST,
     84   TSREQ_PTHREAD_RWLOCK_CREATE_POST,
     85   TSREQ_PTHREAD_RWLOCK_DESTROY_PRE,
     86   TSREQ_PTHREAD_RWLOCK_LOCK_POST,
     87   TSREQ_PTHREAD_RWLOCK_UNLOCK_PRE,
     88   TSREQ_PTHREAD_SPIN_LOCK_INIT_OR_UNLOCK,
     89   TSREQ_POSIX_SEM_INIT_POST,
     90   TSREQ_POSIX_SEM_DESTROY_PRE,
     91   TSREQ_SIGNAL,
     92   TSREQ_WAIT,
     93   TSREQ_CYCLIC_BARRIER_INIT,
     94   TSREQ_CYCLIC_BARRIER_WAIT_BEFORE,
     95   TSREQ_CYCLIC_BARRIER_WAIT_AFTER,
     96   TSREQ_GET_MY_SEGMENT,
     97   TSREQ_GET_THREAD_ID,
     98   TSREQ_GET_VG_THREAD_ID,
     99   TSREQ_GET_SEGMENT_ID,
    100   TSREQ_THREAD_SANITIZER_QUERY,
    101   TSREQ_FLUSH_STATE,
    102   TSREQ_MUTEX_IS_NOT_PHB,  // The opposite of TSREQ_MUTEX_IS_USED_AS_CONDVAR.
    103   TSREQ_FLUSH_EXPECTED_RACES
    104 };
    105 #endif  // TS_VALGRIND_CLIENT_REQUESTS_H_
    106 // end. {{{1
    107 // vim:shiftwidth=2:softtabstop=2:expandtab
    108