Skip to content

Commit 436f408

Browse files
philmdpm215
authored andcommitted
target/arm: Convert power control DPRINTF() uses to trace events
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
1 parent 674fe90 commit 436f408

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

target/arm/arm-powerctl.c

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,12 @@
1717
#include "qemu/main-loop.h"
1818
#include "system/tcg.h"
1919
#include "target/arm/multiprocessing.h"
20-
21-
#ifndef DEBUG_ARM_POWERCTL
22-
#define DEBUG_ARM_POWERCTL 0
23-
#endif
24-
25-
#define DPRINTF(fmt, args...) \
26-
do { \
27-
if (DEBUG_ARM_POWERCTL) { \
28-
fprintf(stderr, "[ARM]%s: " fmt , __func__, ##args); \
29-
} \
30-
} while (0)
20+
#include "trace.h"
3121

3222
CPUState *arm_get_cpu_by_id(uint64_t id)
3323
{
3424
CPUState *cpu;
3525

36-
DPRINTF("cpu %" PRId64 "\n", id);
37-
3826
CPU_FOREACH(cpu) {
3927
ARMCPU *armcpu = ARM_CPU(cpu);
4028

@@ -102,9 +90,9 @@ int arm_set_cpu_on(uint64_t cpuid, uint64_t entry, uint64_t context_id,
10290

10391
assert(bql_locked());
10492

105-
DPRINTF("cpu %" PRId64 " (EL %d, %s) @ 0x%" PRIx64 " with R0 = 0x%" PRIx64
106-
"\n", cpuid, target_el, target_aa64 ? "aarch64" : "aarch32", entry,
107-
context_id);
93+
trace_arm_powerctl_set_cpu_on(cpuid, target_el,
94+
target_aa64 ? "aarch64" : "aarch32",
95+
entry, context_id);
10896

10997
/* requested EL level need to be in the 1 to 3 range */
11098
assert((target_el > 0) && (target_el < 4));
@@ -208,6 +196,8 @@ int arm_set_cpu_on_and_reset(uint64_t cpuid)
208196

209197
assert(bql_locked());
210198

199+
trace_arm_powerctl_set_cpu_on_and_reset(cpuid);
200+
211201
/* Retrieve the cpu we are powering up */
212202
target_cpu_state = arm_get_cpu_by_id(cpuid);
213203
if (!target_cpu_state) {
@@ -261,7 +251,7 @@ int arm_set_cpu_off(uint64_t cpuid)
261251

262252
assert(bql_locked());
263253

264-
DPRINTF("cpu %" PRId64 "\n", cpuid);
254+
trace_arm_powerctl_set_cpu_off(cpuid);
265255

266256
/* change to the cpu we are powering up */
267257
target_cpu_state = arm_get_cpu_by_id(cpuid);
@@ -297,7 +287,7 @@ int arm_reset_cpu(uint64_t cpuid)
297287

298288
assert(bql_locked());
299289

300-
DPRINTF("cpu %" PRId64 "\n", cpuid);
290+
trace_arm_powerctl_set_cpu_off(cpuid);
301291

302292
/* change to the cpu we are resetting */
303293
target_cpu_state = arm_get_cpu_by_id(cpuid);

target/arm/trace-events

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ arm_gt_update_irq(int timer, int irqstate) "gt_update_irq: timer %d irqstate %d"
1313

1414
# kvm.c
1515
kvm_arm_fixup_msi_route(uint64_t iova, uint64_t gpa) "MSI iova = 0x%"PRIx64" is translated into 0x%"PRIx64
16+
17+
# arm-powerctl.c
18+
arm_powerctl_set_cpu_on(uint64_t mp_aff, unsigned target_el, const char *mode, uint64_t entry, uint64_t context_id) "cpu %" PRIu64 " (EL %u, %s) @ 0x%" PRIx64 " with R0 = 0x%" PRIx64
19+
arm_powerctl_set_cpu_on_and_reset(uint64_t mp_aff) "cpu %" PRIu64
20+
arm_powerctl_set_cpu_off(uint64_t mp_aff) "cpu %" PRIu64
21+
arm_powerctl_reset_cpu(uint64_t mp_aff) "cpu %" PRIu64

0 commit comments

Comments
 (0)