OSDN Git Service

perf timechart: Add p_state_end helper
authorShang XiaoJing <shangxiaojing@huawei.com>
Thu, 8 Sep 2022 02:11:41 +0000 (10:11 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 4 Oct 2022 11:55:21 +0000 (08:55 -0300)
commit3e8d21b922af782954d083d938c117b488c4578c
treeb7750370472edaa5fe32fa271405c54a5c0b302e
parent569c746b8a1eab64ebf5b3ebb5d414742c8fc40b
perf timechart: Add p_state_end helper

Wrap repeated code in helper functions p_state_end, which alloc a new
power_event recording last pstate, and insert to the head of
tchart->power_events.

Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220908021141.27134-5-shangxiaojing@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-timechart.c