ANDROID: cpuhp/pause: add trace points for pause and resume
Add a tracepoint for pause and resume which measures the duration of time to perform the entire operation, the cpus acted upon with this event, and the current state of the active cpu mask. This should be sufficient for testing pause performance. Bug: 175959069 Change-Id: I9fc269c7d09ac78ec31612d3c552044b72b0e6e3 Signed-off-by: Stephen Dickey <dickey@codeaurora.org>
This commit is contained in:

committed by
Todd Kjos

parent
db9f954eed
commit
614afa949c
@@ -89,6 +89,28 @@ TRACE_EVENT(cpuhp_exit,
|
||||
__entry->cpu, __entry->state, __entry->idx, __entry->ret)
|
||||
);
|
||||
|
||||
TRACE_EVENT(cpuhp_pause,
|
||||
TP_PROTO(struct cpumask *cpus, u64 start_time, unsigned char pause),
|
||||
|
||||
TP_ARGS(cpus, start_time, pause),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field( unsigned int, cpus )
|
||||
__field( unsigned int, active_cpus )
|
||||
__field( unsigned int, time )
|
||||
__field( unsigned char, pause )
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->cpus = cpumask_bits(cpus)[0];
|
||||
__entry->active_cpus = cpumask_bits(cpu_active_mask)[0];
|
||||
__entry->time = div64_u64(sched_clock() - start_time, 1000);
|
||||
__entry->pause = pause;
|
||||
),
|
||||
|
||||
TP_printk("req_cpus=0x%x act_cpus=0x%x time=%u us paused=%d",
|
||||
__entry->cpus, __entry->active_cpus, __entry->time, __entry->pause)
|
||||
);
|
||||
#endif
|
||||
|
||||
/* This part must be outside protection */
|
||||
|
10
kernel/cpu.c
10
kernel/cpu.c
@@ -1135,6 +1135,9 @@ int pause_cpus(struct cpumask *cpus)
|
||||
{
|
||||
int err = 0;
|
||||
int cpu;
|
||||
u64 start_time = 0;
|
||||
|
||||
start_time = sched_clock();
|
||||
|
||||
cpu_maps_update_begin();
|
||||
|
||||
@@ -1232,6 +1235,8 @@ err_cpus_write_unlock:
|
||||
err_cpu_maps_update:
|
||||
cpu_maps_update_done();
|
||||
|
||||
trace_cpuhp_pause(cpus, start_time, 1);
|
||||
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pause_cpus);
|
||||
@@ -1240,6 +1245,9 @@ int resume_cpus(struct cpumask *cpus)
|
||||
{
|
||||
unsigned int cpu;
|
||||
int err = 0;
|
||||
u64 start_time = 0;
|
||||
|
||||
start_time = sched_clock();
|
||||
|
||||
cpu_maps_update_begin();
|
||||
|
||||
@@ -1298,6 +1306,8 @@ err_cpus_write_unlock:
|
||||
err_cpu_maps_update:
|
||||
cpu_maps_update_done();
|
||||
|
||||
trace_cpuhp_pause(cpus, start_time, 0);
|
||||
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(resume_cpus);
|
||||
|
Reference in New Issue
Block a user