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 19extern uint64_t start_time, end_time; 20extern uint64_t elapsed_usecs; 21extern uint64_t Now(); 22 23struct TranslationBlock; 24 25// The simulated time, in clock ticks, starting with one. 26extern uint64_t sim_time; 27extern uint64_t trace_static_bb_num(void);; 28 29// This variable == 1 if we are currently tracing, otherwise == 0. 30extern int tracing; 31extern int trace_all_addr; 32extern int trace_cache_miss; 33 34extern void start_tracing(); 35extern void stop_tracing(); 36extern void trace_init(const char *filename); 37extern void trace_bb_start(uint32_t bb_addr); 38extern void trace_add_insn(uint32_t insn, int is_thumb); 39extern void trace_bb_end(); 40 41extern int get_insn_ticks_arm(uint32_t insn); 42extern int get_insn_ticks_thumb(uint32_t insn); 43 44extern void trace_exception(uint32_t pc); 45extern void trace_bb_helper(uint64_t bb_num, struct TranslationBlock *tb); 46extern void trace_insn_helper(); 47extern void sim_dcache_load(uint32_t addr); 48extern void sim_dcache_store(uint32_t addr, uint32_t val); 49extern void sim_dcache_swp(uint32_t addr); 50extern void trace_interpreted_method(uint32_t addr, int call_type); 51 52extern const char *trace_filename; 53extern int tracing; 54extern int trace_cache_miss; 55extern int trace_all_addr; 56 57// Trace process/thread operations 58extern void trace_switch(int pid); 59extern void trace_fork(int tgid, int pid); 60extern void trace_clone(int tgid, int pid); 61extern void trace_exit(int exitcode); 62extern void trace_name(char *name); 63 64#endif /* TRACE_H */ 65