From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753030AbbIICsc (ORCPT ); Tue, 8 Sep 2015 22:48:32 -0400 Received: from mga14.intel.com ([192.55.52.115]:10738 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751972AbbIICsW (ORCPT ); Tue, 8 Sep 2015 22:48:22 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,494,1437462000"; d="scan'208";a="785497267" From: kan.liang@intel.com To: acme@kernel.org, jolsa@kernel.org Cc: a.p.zijlstra@chello.nl, luto@kernel.org, mingo@redhat.com, eranian@google.com, ak@linux.intel.com, mark.rutland@arm.com, adrian.hunter@intel.com, namhyung@kernel.org, linux-kernel@vger.kernel.org, Kan Liang Subject: [PATCH V9 0/6] Freq/CPU%/CORE_BUSY% support Date: Tue, 8 Sep 2015 15:32:43 -0400 Message-Id: <1441740769-61236-1-git-send-email-kan.liang@intel.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kan Liang This patch set supports per-sample freq/CPU%/CORE_BUSY% print in perf report. For printing these information, the perf.data file must have been obtained by group read and using special events cycles, ref-cycles, msr/tsc/, msr/aperf/ or msr/mperf/. - Freq (MHz): The frequency during the sample interval. Needs cycles ref-cycles event. - CPU%: CPU utilization during the sample interval. Needs ref-cycles and msr/tsc/ events. - CORE_BUSY%: actual percent performance (APERF/MPERF%) during the sample interval. Needs msr/aperf/ and msr/mperf/ events. Here is an example: $ perf record --freq-perf ~/tchain_edit $ perf report --stdio --freq-perf Overhead FREQ MHz CPU% CORE_BUSY% Command Shared Object Symbol ........................................ ......... ..... .......... ........... ................ ...................... 99.54% 99.54% 99.53% 99.53% 99.53% 2301 96 99 tchain_edit tchain_edit [.] f3 0.20% 0.20% 0.20% 0.20% 0.20% 2301 98 99 tchain_edit tchain_edit [.] f2 0.05% 0.05% 0.05% 0.05% 0.05% 2300 98 99 tchain_edit [kernel.vmlinux] [k] read_tsc Changes since V1: - Save cpu max freq to header when recording - Read cpu max freq and msr type from header when reporting Changes since V2: - Introduce generic FEAT for CPU related data stored - Make cpu max freq and msr type part of perf_session_env - rename cpu_u to cpu_util - Don't save sample value in perf_sample and discards new iterator. Calculating the freq_perf_info in add_entry_cb callback - Introduce symbol_conf.freq_perf_type for related hpp column visibility Changes since V3: - add a identifier 'tag' for CPU attributes, max frequency. - add backpointers to evlist for env, and evsel for evlist. - Use bitmask for freq_perf_type - Replace macros by functions to caculate freq, cpu_util and core_busy - Move all caculation codes under symbol_conf.show_freq_perf condition. Changes since V4: - Store cpu attributes id as tag and more readable cpu_attr Changes since V5: - Rename freq to max_freq and use it - Add a loop in process_cpu_attributes to facility future extension Changes since V6: - Split rename perf_session_env and add backpointer to evlist patches Changes since V7: - Introduce --freq-perf option for perf record - Factor out fix for dump_sample Changes since V8: - Rename --show-freq-perf to --freq-perf - --freq-perf option imply --group Kan Liang (6): perf,tools: introduce generic FEAT for CPU attributes perf,tools: read msr pmu type from header. perf, record: introduce --freq-perf option perf,tools: Dump per-sample freq/CPU%/CORE_BUSY% in report -D perf,tools: caculate and save freq/CPU%/CORE_BUSY% in he_stat perf,tools: Show freq/CPU%/CORE_BUSY% in perf report by --freq-perf tools/perf/Documentation/perf-record.txt | 4 ++ tools/perf/Documentation/perf-report.txt | 12 ++++++ tools/perf/builtin-record.c | 39 +++++++++++++++++- tools/perf/builtin-report.c | 59 ++++++++++++++++++++++++++ tools/perf/ui/hist.c | 71 +++++++++++++++++++++++++++++--- tools/perf/util/cpumap.c | 32 ++++++++++++++ tools/perf/util/cpumap.h | 1 + tools/perf/util/header.c | 62 ++++++++++++++++++++++++++++ tools/perf/util/header.h | 13 ++++++ tools/perf/util/hist.h | 3 ++ tools/perf/util/session.c | 31 ++++++++++++-- tools/perf/util/session.h | 64 ++++++++++++++++++++++++++++ tools/perf/util/sort.c | 3 ++ tools/perf/util/sort.h | 3 ++ tools/perf/util/symbol.h | 12 +++++- 15 files changed, 399 insertions(+), 10 deletions(-) -- 1.8.3.1