The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 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 "trace_common.h" |
| 18 | |
| 19 | extern uint64_t start_time, end_time; |
| 20 | extern uint64_t elapsed_usecs; |
David 'Digit' Turner | 6eaacfb | 2011-05-10 10:57:17 +0200 | [diff] [blame] | 21 | extern uint64_t Now(); |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 22 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 23 | struct TranslationBlock; |
| 24 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 25 | // The simulated time, in clock ticks, starting with one. |
| 26 | extern uint64_t sim_time; |
David 'Digit' Turner | 8ee4e5e | 2011-05-09 13:57:15 +0200 | [diff] [blame] | 27 | extern uint64_t trace_static_bb_num(void);; |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 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); |
Jack Veenstra | 0139786 | 2009-05-18 16:02:07 -0700 | [diff] [blame] | 38 | extern void trace_add_insn(uint32_t insn, int is_thumb); |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 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 | |
David 'Digit' Turner | 6eaacfb | 2011-05-10 10:57:17 +0200 | [diff] [blame] | 44 | extern void trace_exception(uint32_t pc); |
| 45 | extern void trace_bb_helper(uint64_t bb_num, struct TranslationBlock *tb); |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 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 | |
David 'Digit' Turner | 4e024bb | 2010-09-22 14:19:28 +0200 | [diff] [blame] | 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 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 64 | #endif /* TRACE_H */ |