Skip to content

Commit 1b65b4f

Browse files
atwufeirth7680
authored andcommitted
accel/tcg: remove CONFIG_PROFILER
TBStats will be introduced to replace CONFIG_PROFILER totally, here remove all CONFIG_PROFILER related stuffs first. Signed-off-by: Vanderson M. do Rosario <[email protected]> Signed-off-by: Alex Bennée <[email protected]> Signed-off-by: Fei Wu <[email protected]> Reviewed-by: Richard Henderson <[email protected]> Message-Id: <[email protected]> Signed-off-by: Richard Henderson <[email protected]>
1 parent ea185a5 commit 1b65b4f

File tree

13 files changed

+0
-375
lines changed

13 files changed

+0
-375
lines changed

accel/tcg/monitor.c

-31
Original file line numberDiff line numberDiff line change
@@ -81,37 +81,6 @@ HumanReadableText *qmp_x_query_opcount(Error **errp)
8181
return human_readable_text_from_str(buf);
8282
}
8383

84-
#ifdef CONFIG_PROFILER
85-
86-
int64_t dev_time;
87-
88-
HumanReadableText *qmp_x_query_profile(Error **errp)
89-
{
90-
g_autoptr(GString) buf = g_string_new("");
91-
static int64_t last_cpu_exec_time;
92-
int64_t cpu_exec_time;
93-
int64_t delta;
94-
95-
cpu_exec_time = tcg_cpu_exec_time();
96-
delta = cpu_exec_time - last_cpu_exec_time;
97-
98-
g_string_append_printf(buf, "async time %" PRId64 " (%0.3f)\n",
99-
dev_time, dev_time / (double)NANOSECONDS_PER_SECOND);
100-
g_string_append_printf(buf, "qemu time %" PRId64 " (%0.3f)\n",
101-
delta, delta / (double)NANOSECONDS_PER_SECOND);
102-
last_cpu_exec_time = cpu_exec_time;
103-
dev_time = 0;
104-
105-
return human_readable_text_from_str(buf);
106-
}
107-
#else
108-
HumanReadableText *qmp_x_query_profile(Error **errp)
109-
{
110-
error_setg(errp, "Internal profiler not compiled");
111-
return NULL;
112-
}
113-
#endif
114-
11584
static void hmp_tcg_register(void)
11685
{
11786
monitor_register_hmp_info_hrt("jit", qmp_x_query_jit);

accel/tcg/tcg-accel-ops.c

-10
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,10 @@ void tcg_cpus_destroy(CPUState *cpu)
7070
int tcg_cpus_exec(CPUState *cpu)
7171
{
7272
int ret;
73-
#ifdef CONFIG_PROFILER
74-
int64_t ti;
75-
#endif
7673
assert(tcg_enabled());
77-
#ifdef CONFIG_PROFILER
78-
ti = profile_getclock();
79-
#endif
8074
cpu_exec_start(cpu);
8175
ret = cpu_exec(cpu);
8276
cpu_exec_end(cpu);
83-
#ifdef CONFIG_PROFILER
84-
qatomic_set(&tcg_ctx->prof.cpu_exec_time,
85-
tcg_ctx->prof.cpu_exec_time + profile_getclock() - ti);
86-
#endif
8777
return ret;
8878
}
8979

accel/tcg/translate-all.c

-33
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,6 @@ void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb,
202202
uintptr_t host_pc)
203203
{
204204
uint64_t data[TARGET_INSN_START_WORDS];
205-
#ifdef CONFIG_PROFILER
206-
TCGProfile *prof = &tcg_ctx->prof;
207-
int64_t ti = profile_getclock();
208-
#endif
209205
int insns_left = cpu_unwind_data_from_tb(tb, host_pc, data);
210206

211207
if (insns_left < 0) {
@@ -222,12 +218,6 @@ void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb,
222218
}
223219

224220
cpu->cc->tcg_ops->restore_state_to_opc(cpu, tb, data);
225-
226-
#ifdef CONFIG_PROFILER
227-
qatomic_set(&prof->restore_time,
228-
prof->restore_time + profile_getclock() - ti);
229-
qatomic_set(&prof->restore_count, prof->restore_count + 1);
230-
#endif
231221
}
232222

233223
bool cpu_restore_state(CPUState *cpu, uintptr_t host_pc)
@@ -290,13 +280,6 @@ static int setjmp_gen_code(CPUArchState *env, TranslationBlock *tb,
290280
tcg_ctx->cpu = NULL;
291281
*max_insns = tb->icount;
292282

293-
#ifdef CONFIG_PROFILER
294-
qatomic_set(&tcg_ctx->prof.tb_count, tcg_ctx->prof.tb_count + 1);
295-
qatomic_set(&tcg_ctx->prof.interm_time,
296-
tcg_ctx->prof.interm_time + profile_getclock() - *ti);
297-
*ti = profile_getclock();
298-
#endif
299-
300283
return tcg_gen_code(tcg_ctx, tb, pc);
301284
}
302285

@@ -310,9 +293,6 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
310293
tb_page_addr_t phys_pc;
311294
tcg_insn_unit *gen_code_buf;
312295
int gen_code_size, search_size, max_insns;
313-
#ifdef CONFIG_PROFILER
314-
TCGProfile *prof = &tcg_ctx->prof;
315-
#endif
316296
int64_t ti;
317297
void *host_pc;
318298

@@ -371,12 +351,6 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
371351

372352
tb_overflow:
373353

374-
#ifdef CONFIG_PROFILER
375-
/* includes aborted translations because of exceptions */
376-
qatomic_set(&prof->tb_count1, prof->tb_count1 + 1);
377-
ti = profile_getclock();
378-
#endif
379-
380354
trace_translate_block(tb, pc, tb->tc.ptr);
381355

382356
gen_code_size = setjmp_gen_code(env, tb, pc, host_pc, &max_insns, &ti);
@@ -431,13 +405,6 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
431405
*/
432406
perf_report_code(pc, tb, tcg_splitwx_to_rx(gen_code_buf));
433407

434-
#ifdef CONFIG_PROFILER
435-
qatomic_set(&prof->code_time, prof->code_time + profile_getclock() - ti);
436-
qatomic_set(&prof->code_in_len, prof->code_in_len + tb->size);
437-
qatomic_set(&prof->code_out_len, prof->code_out_len + gen_code_size);
438-
qatomic_set(&prof->search_out_len, prof->search_out_len + search_size);
439-
#endif
440-
441408
if (qemu_loglevel_mask(CPU_LOG_TB_OUT_ASM) &&
442409
qemu_log_in_addr_range(pc)) {
443410
FILE *logfile = qemu_log_trylock();

hmp-commands-info.hx

-15
Original file line numberDiff line numberDiff line change
@@ -360,21 +360,6 @@ SRST
360360
Show host USB devices.
361361
ERST
362362

363-
#if defined(CONFIG_TCG)
364-
{
365-
.name = "profile",
366-
.args_type = "",
367-
.params = "",
368-
.help = "show profiling information",
369-
.cmd_info_hrt = qmp_x_query_profile,
370-
},
371-
#endif
372-
373-
SRST
374-
``info profile``
375-
Show profiling information.
376-
ERST
377-
378363
{
379364
.name = "capture",
380365
.args_type = "",

include/qemu/timer.h

-9
Original file line numberDiff line numberDiff line change
@@ -989,13 +989,4 @@ static inline int64_t cpu_get_host_ticks(void)
989989
}
990990
#endif
991991

992-
#ifdef CONFIG_PROFILER
993-
static inline int64_t profile_getclock(void)
994-
{
995-
return get_clock();
996-
}
997-
998-
extern int64_t dev_time;
999-
#endif
1000-
1001992
#endif

include/tcg/tcg.h

-26
Original file line numberDiff line numberDiff line change
@@ -478,27 +478,6 @@ static inline TCGRegSet output_pref(const TCGOp *op, unsigned i)
478478
return i < ARRAY_SIZE(op->output_pref) ? op->output_pref[i] : 0;
479479
}
480480

481-
typedef struct TCGProfile {
482-
int64_t cpu_exec_time;
483-
int64_t tb_count1;
484-
int64_t tb_count;
485-
int64_t op_count; /* total insn count */
486-
int op_count_max; /* max insn per TB */
487-
int temp_count_max;
488-
int64_t temp_count;
489-
int64_t del_op_count;
490-
int64_t code_in_len;
491-
int64_t code_out_len;
492-
int64_t search_out_len;
493-
int64_t interm_time;
494-
int64_t code_time;
495-
int64_t la_time;
496-
int64_t opt_time;
497-
int64_t restore_count;
498-
int64_t restore_time;
499-
int64_t table_op_count[NB_OPS];
500-
} TCGProfile;
501-
502481
struct TCGContext {
503482
uint8_t *pool_cur, *pool_end;
504483
TCGPool *pool_first, *pool_current, *pool_first_large;
@@ -528,10 +507,6 @@ struct TCGContext {
528507
tcg_insn_unit *code_buf; /* pointer for start of tb */
529508
tcg_insn_unit *code_ptr; /* pointer for running end of tb */
530509

531-
#ifdef CONFIG_PROFILER
532-
TCGProfile prof;
533-
#endif
534-
535510
#ifdef CONFIG_DEBUG_TCG
536511
int goto_tb_issue_mask;
537512
const TCGOpcode *vecop_list;
@@ -871,7 +846,6 @@ static inline TCGv_ptr tcg_temp_new_ptr(void)
871846
return temp_tcgv_ptr(t);
872847
}
873848

874-
int64_t tcg_cpu_exec_time(void);
875849
void tcg_dump_info(GString *buf);
876850
void tcg_dump_op_count(GString *buf);
877851

meson.build

-2
Original file line numberDiff line numberDiff line change
@@ -2121,7 +2121,6 @@ if numa.found()
21212121
dependencies: numa))
21222122
endif
21232123
config_host_data.set('CONFIG_OPENGL', opengl.found())
2124-
config_host_data.set('CONFIG_PROFILER', get_option('profiler'))
21252124
config_host_data.set('CONFIG_RBD', rbd.found())
21262125
config_host_data.set('CONFIG_RDMA', rdma.found())
21272126
config_host_data.set('CONFIG_SAFESTACK', get_option('safe_stack'))
@@ -4087,7 +4086,6 @@ if 'objc' in all_languages
40874086
summary_info += {'QEMU_OBJCFLAGS': ' '.join(qemu_common_flags)}
40884087
endif
40894088
summary_info += {'QEMU_LDFLAGS': ' '.join(qemu_ldflags)}
4090-
summary_info += {'profiler': get_option('profiler')}
40914089
summary_info += {'link-time optimization (LTO)': get_option('b_lto')}
40924090
summary_info += {'PIE': get_option('b_pie')}
40934091
summary_info += {'static build': get_option('prefer_static')}

meson_options.txt

-2
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,6 @@ option('qom_cast_debug', type: 'boolean', value: true,
345345
option('gprof', type: 'boolean', value: false,
346346
description: 'QEMU profiling with gprof',
347347
deprecated: true)
348-
option('profiler', type: 'boolean', value: false,
349-
description: 'profiler support')
350348
option('slirp_smbd', type : 'feature', value : 'auto',
351349
description: 'use smbd (at path --smbd=*) in slirp networking')
352350

qapi/machine.json

-18
Original file line numberDiff line numberDiff line change
@@ -1575,24 +1575,6 @@
15751575
'if': 'CONFIG_TCG',
15761576
'features': [ 'unstable' ] }
15771577

1578-
##
1579-
# @x-query-profile:
1580-
#
1581-
# Query TCG profiling information
1582-
#
1583-
# Features:
1584-
#
1585-
# @unstable: This command is meant for debugging.
1586-
#
1587-
# Returns: profile information
1588-
#
1589-
# Since: 6.2
1590-
##
1591-
{ 'command': 'x-query-profile',
1592-
'returns': 'HumanReadableText',
1593-
'if': 'CONFIG_TCG',
1594-
'features': [ 'unstable' ] }
1595-
15961578
##
15971579
# @x-query-ramblock:
15981580
#

scripts/meson-buildoptions.sh

-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ meson_options_help() {
3939
printf "%s\n" ' jemalloc/system/tcmalloc)'
4040
printf "%s\n" ' --enable-module-upgrades try to load modules from alternate paths for'
4141
printf "%s\n" ' upgrades'
42-
printf "%s\n" ' --enable-profiler profiler support'
4342
printf "%s\n" ' --enable-rng-none dummy RNG, avoid using /dev/(u)random and'
4443
printf "%s\n" ' getrandom()'
4544
printf "%s\n" ' --enable-safe-stack SafeStack Stack Smash Protection (requires'
@@ -401,8 +400,6 @@ _meson_option_parse() {
401400
--with-pkgversion=*) quote_sh "-Dpkgversion=$2" ;;
402401
--enable-png) printf "%s" -Dpng=enabled ;;
403402
--disable-png) printf "%s" -Dpng=disabled ;;
404-
--enable-profiler) printf "%s" -Dprofiler=true ;;
405-
--disable-profiler) printf "%s" -Dprofiler=false ;;
406403
--enable-pvrdma) printf "%s" -Dpvrdma=enabled ;;
407404
--disable-pvrdma) printf "%s" -Dpvrdma=disabled ;;
408405
--enable-qcow1) printf "%s" -Dqcow1=enabled ;;

softmmu/runstate.c

-9
Original file line numberDiff line numberDiff line change
@@ -727,18 +727,9 @@ static bool main_loop_should_exit(int *status)
727727
int qemu_main_loop(void)
728728
{
729729
int status = EXIT_SUCCESS;
730-
#ifdef CONFIG_PROFILER
731-
int64_t ti;
732-
#endif
733730

734731
while (!main_loop_should_exit(&status)) {
735-
#ifdef CONFIG_PROFILER
736-
ti = profile_getclock();
737-
#endif
738732
main_loop_wait(false);
739-
#ifdef CONFIG_PROFILER
740-
dev_time += profile_getclock() - ti;
741-
#endif
742733
}
743734

744735
return status;

0 commit comments

Comments
 (0)