lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161123225208.GE15978@krava>
Date:   Wed, 23 Nov 2016 23:52:08 +0100
From:   Jiri Olsa <jolsa@...hat.com>
To:     kan.liang@...el.com
Cc:     peterz@...radead.org, mingo@...hat.com, acme@...nel.org,
        linux-kernel@...r.kernel.org, alexander.shishkin@...ux.intel.com,
        tglx@...utronix.de, namhyung@...nel.org, jolsa@...nel.org,
        adrian.hunter@...el.com, wangnan0@...wei.com, mark.rutland@....com,
        andi@...stfloor.org
Subject: Re: [PATCH 06/14] perf tools: show NMI overhead

On Wed, Nov 23, 2016 at 04:44:44AM -0500, kan.liang@...el.com wrote:
> From: Kan Liang <kan.liang@...el.com>
> 
> Caculate the total NMI overhead on each CPU, and display them in perf
> report
> 
> Signed-off-by: Kan Liang <kan.liang@...el.com>
> ---
>  tools/perf/builtin-report.c | 11 +++++++++++
>  tools/perf/util/event.h     |  4 ++++
>  tools/perf/util/machine.c   |  9 +++++++++
>  tools/perf/util/session.c   | 18 ++++++++++++++++++
>  4 files changed, 42 insertions(+)
> 
> diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
> index 1416c39..b1437586 100644
> --- a/tools/perf/builtin-report.c
> +++ b/tools/perf/builtin-report.c
> @@ -365,11 +365,22 @@ static int perf_evlist__tty_browse_hists(struct perf_evlist *evlist,
>  					 struct report *rep,
>  					 const char *help)
>  {
> +	struct perf_session *session = rep->session;
>  	struct perf_evsel *pos;
> +	int cpu;
>  
>  	fprintf(stdout, "#\n# Total Lost Samples: %" PRIu64 "\n#\n", evlist->stats.total_lost_samples);
>  	if (symbol_conf.show_overhead) {
>  		fprintf(stdout, "# Overhead:\n");
> +		for (cpu = 0; cpu < session->header.env.nr_cpus_online; cpu++) {
> +			if (!evlist->stats.total_nmi_overhead[cpu][0])
> +				continue;
> +			if (rep->cpu_list && !test_bit(cpu, rep->cpu_bitmap))
> +				continue;
> +			fprintf(stdout, "#\tCPU %d: NMI#: %" PRIu64 " time: %" PRIu64 " ns\n",
> +				cpu, evlist->stats.total_nmi_overhead[cpu][0],
> +				evlist->stats.total_nmi_overhead[cpu][1]);
> +		}
>  		fprintf(stdout, "#\n");
>  	}
>  	evlist__for_each_entry(evlist, pos) {
> diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
> index d1b179b..7d40d54 100644
> --- a/tools/perf/util/event.h
> +++ b/tools/perf/util/event.h
> @@ -262,6 +262,9 @@ enum auxtrace_error_type {
>   * multipling nr_events[PERF_EVENT_SAMPLE] by a frequency isn't possible to get
>   * the total number of low level events, it is necessary to to sum all struct
>   * sample_event.period and stash the result in total_period.
> + *
> + * The total_nmi_overhead tells exactly the NMI handler overhead on each CPU.
> + * The total NMI# is stored in [0], while the accumulated time is in [1].
>   */

hum, why can't this be stored this in the struct instead.. ?

thanks,
jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ