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] [day] [month] [year] [list]
Date:   Tue, 3 Oct 2017 12:43:27 +0200
From:   Jiri Olsa <jolsa@...hat.com>
To:     yuzhoujian <ufo19890607@...il.com>
Cc:     peterz@...radead.org, mingo@...hat.com,
        alexander.shishkin@...ux.intel.com, jolsa@...nel.org,
        dsahern@...il.com, namhyung@...nel.org, milian.wolff@...b.com,
        arnaldo.melo@...il.com, yuzhoujian@...ichuxing.com,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 4/4] Make all print functions receive the fp argument,
 and opens a dump file in process_event.

On Tue, Sep 26, 2017 at 02:53:17PM +0800, yuzhoujian wrote:

SNIP

> +		fprintf(fp, "%16" PRIx64, sample->phys_addr);
> +	fprintf(fp, "\n");
> +	if (script->tool.per_event_dump)
> +		fclose(fp);
>  }
>  
>  static struct scripting_ops	*scripting_ops;
> @@ -1574,6 +1589,7 @@ static int process_sample_event(struct perf_tool *tool,
>  {
>  	struct perf_script *scr = container_of(tool, struct perf_script, tool);
>  	struct addr_location al;
> +	FILE *fp;
>  
>  	if (perf_time__skip_sample(&scr->ptime, sample->time))
>  		return 0;
> @@ -1601,10 +1617,11 @@ static int process_sample_event(struct perf_tool *tool,
>  	if (cpu_list && !test_bit(sample->cpu, cpu_bitmap))
>  		goto out_put;
>  
> +	fp = tool->per_event_dump ? per_event_dump_file : stdout;

I know you explained this already, but I still can't see this one
being set:

[jolsa@...va perf]$ grep -r per_event_dump_file builtin-script.c
static FILE                     *per_event_dump_file;
        fp = tool->per_event_dump ? per_event_dump_file : stdout;
        fp = tool->per_event_dump ? per_event_dump_file : stdout;
        fp = tool->per_event_dump ? per_event_dump_file : stdout;
        fp = tool->per_event_dump ? per_event_dump_file : stdout;
        fp = tool->per_event_dump ? per_event_dump_file : stdout;
        fp = tool->per_event_dump ? per_event_dump_file : stdout;
        fp = tool->per_event_dump ? per_event_dump_file : stdout;
        fp = tool->per_event_dump ? per_event_dump_file : stdout;

I think we should use per evsel FILE pointers


jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ