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: <20180116194909.GB6183@krava>
Date:   Tue, 16 Jan 2018 20:49:09 +0100
From:   Jiri Olsa <jolsa@...hat.com>
To:     Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:     Jiri Olsa <jolsa@...nel.org>, Ingo Molnar <mingo@...nel.org>,
        linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
        Arnaldo Carvalho de Melo <acme@...hat.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        David Ahern <dsahern@...il.com>,
        Hendrick Brueckner <brueckner@...ux.vnet.ibm.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Thomas Richter <tmricht@...ux.vnet.ibm.com>,
        Wang Nan <wangnan0@...wei.com>
Subject: Re: [PATCH 2/5] perf unwind: Do not look at globals

On Tue, Jan 16, 2018 at 03:26:50PM -0300, Arnaldo Carvalho de Melo wrote:

SNIP

> diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
> index c0debc3f79b6..c0815a37fdb5 100644
> --- a/tools/perf/builtin-c2c.c
> +++ b/tools/perf/builtin-c2c.c
> @@ -2390,9 +2390,10 @@ static int setup_callchain(struct perf_evlist *evlist)
>  	enum perf_call_graph_mode mode = CALLCHAIN_NONE;
>  
>  	if ((sample_type & PERF_SAMPLE_REGS_USER) &&
> -	    (sample_type & PERF_SAMPLE_STACK_USER))
> +	    (sample_type & PERF_SAMPLE_STACK_USER)) {
>  		mode = CALLCHAIN_DWARF;
> -	else if (sample_type & PERF_SAMPLE_BRANCH_STACK)
> +		dwarf_callchain_users = true;
> +	} else if (sample_type & PERF_SAMPLE_BRANCH_STACK)
>  		mode = CALLCHAIN_LBR;
>  	else if (sample_type & PERF_SAMPLE_CALLCHAIN)
>  		mode = CALLCHAIN_FP;
> diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
> index dd4df9a5cd06..6593779224d5 100644
> --- a/tools/perf/builtin-report.c
> +++ b/tools/perf/builtin-report.c
> @@ -338,9 +338,10 @@ static int report__setup_sample_type(struct report *rep)
>  
>  	if (symbol_conf.use_callchain || symbol_conf.cumulate_callchain) {
>  		if ((sample_type & PERF_SAMPLE_REGS_USER) &&
> -		    (sample_type & PERF_SAMPLE_STACK_USER))
> +		    (sample_type & PERF_SAMPLE_STACK_USER)) {
>  			callchain_param.record_mode = CALLCHAIN_DWARF;
> -		else if (sample_type & PERF_SAMPLE_BRANCH_STACK)
> +			dwarf_callchain_users = true;
> +		} else if (sample_type & PERF_SAMPLE_BRANCH_STACK)
>  			callchain_param.record_mode = CALLCHAIN_LBR;
>  		else
>  			callchain_param.record_mode = CALLCHAIN_FP;
> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
> index c1cce474c0f1..08bc818f371b 100644
> --- a/tools/perf/builtin-script.c
> +++ b/tools/perf/builtin-script.c
> @@ -2919,9 +2919,10 @@ static void script__setup_sample_type(struct perf_script *script)
>  
>  	if (symbol_conf.use_callchain || symbol_conf.cumulate_callchain) {
>  		if ((sample_type & PERF_SAMPLE_REGS_USER) &&
> -		    (sample_type & PERF_SAMPLE_STACK_USER))
> +		    (sample_type & PERF_SAMPLE_STACK_USER)) {
>  			callchain_param.record_mode = CALLCHAIN_DWARF;
> -		else if (sample_type & PERF_SAMPLE_BRANCH_STACK)
> +			dwarf_callchain_users = true;
> +		} else if (sample_type & PERF_SAMPLE_BRANCH_STACK)
>  			callchain_param.record_mode = CALLCHAIN_LBR;
>  		else
>  			callchain_param.record_mode = CALLCHAIN_FP;
> diff --git a/tools/perf/tests/dwarf-unwind.c b/tools/perf/tests/dwarf-unwind.c
> index ac40e05bcab4..260418969120 100644
> --- a/tools/perf/tests/dwarf-unwind.c
> +++ b/tools/perf/tests/dwarf-unwind.c
> @@ -173,6 +173,7 @@ int test__dwarf_unwind(struct test *test __maybe_unused, int subtest __maybe_unu
>  	}
>  
>  	callchain_param.record_mode = CALLCHAIN_DWARF;
> +	dwarf_callchain_users = true;
>  
>  	if (init_live_machine(machine)) {
>  		pr_err("Could not init machine\n");
> diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c
> index 082505d08d72..32ef7bdca1cf 100644
> --- a/tools/perf/util/callchain.c
> +++ b/tools/perf/util/callchain.c
> @@ -37,6 +37,15 @@ struct callchain_param callchain_param = {
>  	CALLCHAIN_PARAM_DEFAULT
>  };
>  
> +/*
> + * Are there any events usind DWARF callchains?
> + *
> + * I.e.
> + *
> + * -e cycles/call-graph=dwarf/
> + */
> +bool dwarf_callchain_users;

hum, I don't follow.. this bool seems to mirror the usage of
'param->record_mode = CALLCHAIN_DWARF', whats the difference?

also, the patch title says 'Do not look at globals', while inside you
add new global dwarf_callchain_users and work with it.. what do I miss?

I'll check tomorrow with clean head ;-)

jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ