|
17 | 17 | #include "qemu/main-loop.h" |
18 | 18 | #include "system/tcg.h" |
19 | 19 | #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" |
31 | 21 |
|
32 | 22 | CPUState *arm_get_cpu_by_id(uint64_t id) |
33 | 23 | { |
34 | 24 | CPUState *cpu; |
35 | 25 |
|
36 | | - DPRINTF("cpu %" PRId64 "\n", id); |
37 | | - |
38 | 26 | CPU_FOREACH(cpu) { |
39 | 27 | ARMCPU *armcpu = ARM_CPU(cpu); |
40 | 28 |
|
@@ -102,9 +90,9 @@ int arm_set_cpu_on(uint64_t cpuid, uint64_t entry, uint64_t context_id, |
102 | 90 |
|
103 | 91 | assert(bql_locked()); |
104 | 92 |
|
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); |
108 | 96 |
|
109 | 97 | /* requested EL level need to be in the 1 to 3 range */ |
110 | 98 | assert((target_el > 0) && (target_el < 4)); |
@@ -208,6 +196,8 @@ int arm_set_cpu_on_and_reset(uint64_t cpuid) |
208 | 196 |
|
209 | 197 | assert(bql_locked()); |
210 | 198 |
|
| 199 | + trace_arm_powerctl_set_cpu_on_and_reset(cpuid); |
| 200 | + |
211 | 201 | /* Retrieve the cpu we are powering up */ |
212 | 202 | target_cpu_state = arm_get_cpu_by_id(cpuid); |
213 | 203 | if (!target_cpu_state) { |
@@ -261,7 +251,7 @@ int arm_set_cpu_off(uint64_t cpuid) |
261 | 251 |
|
262 | 252 | assert(bql_locked()); |
263 | 253 |
|
264 | | - DPRINTF("cpu %" PRId64 "\n", cpuid); |
| 254 | + trace_arm_powerctl_set_cpu_off(cpuid); |
265 | 255 |
|
266 | 256 | /* change to the cpu we are powering up */ |
267 | 257 | target_cpu_state = arm_get_cpu_by_id(cpuid); |
@@ -297,7 +287,7 @@ int arm_reset_cpu(uint64_t cpuid) |
297 | 287 |
|
298 | 288 | assert(bql_locked()); |
299 | 289 |
|
300 | | - DPRINTF("cpu %" PRId64 "\n", cpuid); |
| 290 | + trace_arm_powerctl_set_cpu_off(cpuid); |
301 | 291 |
|
302 | 292 | /* change to the cpu we are resetting */ |
303 | 293 | target_cpu_state = arm_get_cpu_by_id(cpuid); |
|
0 commit comments