Home | History | Annotate | Download | only in qemu
      1 /* Copyright (C) 2006-2007 The Android Open Source Project
      2 **
      3 ** This software is licensed under the terms of the GNU General Public
      4 ** License version 2, as published by the Free Software Foundation, and
      5 ** may be copied, distributed, and modified under those terms.
      6 **
      7 ** This program is distributed in the hope that it will be useful,
      8 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
      9 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     10 ** GNU General Public License for more details.
     11 */
     12 
     13 #ifndef TRACE_H
     14 #define TRACE_H
     15 
     16 #include <inttypes.h>
     17 #include "android-trace_common.h"
     18 
     19 extern uint64_t start_time, end_time;
     20 extern uint64_t elapsed_usecs;
     21 extern uint64_t Now();
     22 
     23 struct TranslationBlock;
     24 
     25 // The simulated time, in clock ticks, starting with one.
     26 extern uint64_t sim_time;
     27 extern uint64_t trace_static_bb_num(void);;
     28 
     29 // This variable == 1 if we are currently tracing, otherwise == 0.
     30 extern int tracing;
     31 extern int trace_all_addr;
     32 extern int trace_cache_miss;
     33 
     34 extern void start_tracing();
     35 extern void stop_tracing();
     36 extern void trace_init(const char *filename);
     37 extern void trace_bb_start(uint32_t bb_addr);
     38 extern void trace_add_insn(uint32_t insn, int is_thumb);
     39 extern void trace_bb_end();
     40 
     41 extern int get_insn_ticks_arm(uint32_t insn);
     42 extern int get_insn_ticks_thumb(uint32_t  insn);
     43 
     44 extern void trace_exception(uint32_t pc);
     45 extern void trace_bb_helper(uint64_t bb_num, struct TranslationBlock *tb);
     46 extern void trace_insn_helper();
     47 extern void sim_dcache_load(uint32_t addr);
     48 extern void sim_dcache_store(uint32_t addr, uint32_t val);
     49 extern void sim_dcache_swp(uint32_t addr);
     50 extern void trace_interpreted_method(uint32_t addr, int call_type);
     51 
     52 extern const char *trace_filename;
     53 extern int tracing;
     54 extern int trace_cache_miss;
     55 extern int trace_all_addr;
     56 
     57 // Trace process/thread operations
     58 extern void trace_switch(int pid);
     59 extern void trace_fork(int tgid, int pid);
     60 extern void trace_clone(int tgid, int pid);
     61 extern void trace_exit(int exitcode);
     62 extern void trace_name(char *name);
     63 
     64 #endif /* TRACE_H */
     65