Skip to content

Commit

Permalink
Remove perfetto debug counters.
Browse files Browse the repository at this point in the history
  • Loading branch information
qwattash committed Mar 31, 2023
1 parent 9ae03c6 commit 1d91718
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 55 deletions.
18 changes: 0 additions & 18 deletions accel/tcg/cpu-exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,24 +702,6 @@ static inline void cpu_loop_exec_tb(CPUState *cpu, TranslationBlock *tb,
/* Instruction counter expired. */
assert(icount_enabled());
#ifndef CONFIG_USER_ONLY
#if defined(CONFIG_TCG_LOG_INSTR) && defined(CONFIG_TRACE_PERFETTO)
{
int64_t executed = cpu->icount_budget -
(cpu_neg(cpu)->icount_decr.u16.low + cpu->icount_extra);
/*
* Assume that it is not possible to exit a tb chain with
* where tracing occurred but the first or last tb don't have
* the tracing flag set.
*/
if (tb->cflags & CF_LOG_INSTR) {
qemu_log_instr_counter(cpu, QEMU_LOG_INSTR_DBG_INSN_TRACING_ICOUNT,
executed);
} else {
qemu_log_instr_counter(cpu, QEMU_LOG_INSTR_DBG_INSN_ICOUNT,
executed);
}
}
#endif
/* Ensure global icount has gone forward */
icount_update(cpu);

Expand Down
8 changes: 0 additions & 8 deletions accel/tcg/log_instr.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ static trace_backend_hooks_t trace_backends[] = {
#ifdef CONFIG_TRACE_PERFETTO
.init = init_perfetto_backend,
.sync = sync_perfetto_backend,
.emit_debug = emit_perfetto_debug,
.emit_instr = emit_perfetto_entry
#endif
}, {
Expand Down Expand Up @@ -1291,13 +1290,6 @@ void qemu_log_instr_flush(CPUArchState *env)
cpulog->ring_tail = cpulog->ring_head;
}

void qemu_log_instr_counter(CPUState *cpu, QEMUDebugCounter name, long value)
{
if (trace_backend->emit_debug) {
trace_backend->emit_debug(cpu->env_ptr, name, value);
}
}

/* Instruction logging helpers */

/* Dump out all the accumalated printf's */
Expand Down
6 changes: 0 additions & 6 deletions include/exec/log_instr.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,12 +350,6 @@ void qemu_log_instr_event_dump_cap_int(log_event_t *evt, const char *reg_name,
*/
void qemu_log_instr_extra(CPUArchState *env, const char *msg, ...);

/*
* Tracepoint for qemu internals.
* This should not be used for guest events.
*/
void qemu_log_instr_counter(CPUState *cpu, QEMUDebugCounter name, long value);

#else /* ! CONFIG_TCG_LOG_INSTR */
#define qemu_log_instr_enabled(cpu) false
#define qemu_log_instr_start(env, mode, pc)
Expand Down
1 change: 0 additions & 1 deletion include/exec/log_instr_perfetto.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ typedef void *cap_register_handle;

void perfetto_init_cpu(int cpu_index, const char *logfile, void **backend_data);
void perfetto_sync_cpu(void *backend_data);
void perfetto_emit_debug(void *backend_data, QEMUDebugCounter name, long value);
void perfetto_emit_instr(void *backend_data, cpu_log_entry_handle entry_handle);

/*
Expand Down
12 changes: 0 additions & 12 deletions include/qemu/log_instr.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,18 +205,6 @@ typedef struct {
};
} log_event_t;

/*
* Internal QEMU debug counters.
* These are always traced, regardless of whether tracing is enabled or not.
* This enumeration defines the name of the debug counters for the backends
* to use.
*/
typedef enum {
QEMU_LOG_INSTR_DBG_INSN_ICOUNT = 0,
QEMU_LOG_INSTR_DBG_INSN_TRACING_ICOUNT = 1,
/* Must be last */
QEMU_LOG_INSTR_DBG_MAX
} QEMUDebugCounter;
void qemu_log_instr_conf_logfile(const char *name);

#ifdef CONFIG_TRACE_PERFETTO
Expand Down
10 changes: 0 additions & 10 deletions trace_extra/trace_perfetto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -552,16 +552,6 @@ extern "C" void perfetto_sync_cpu(void *backend_data)
perfetto::TrackEvent::Flush();
}

extern "C" void perfetto_emit_debug(void *backend_data, QEMUDebugCounter index,
long value)
{
auto *data = reinterpret_cast<perfetto_backend_data *>(backend_data);
qemu_fallback_state *cpu_state = data->ctx_tracker.get_cpu_state();

TRACE_COUNTER("qemu-debug", cpu_state->get_debug_counter_track(index),
value);
}

extern "C" void perfetto_emit_instr(void *backend_data,
cpu_log_entry_handle entry)
{
Expand Down

0 comments on commit 1d91718

Please sign in to comment.