From: Jiri Olsa <jolsa@redhat.com>
To: yuzhoujian <ufo19890607@gmail.com>
Cc: peterz@infradead.org, mingo@redhat.com,
alexander.shishkin@linux.intel.com, jolsa@kernel.org,
dsahern@gmail.com, namhyung@kernel.org, milian.wolff@kdab.com,
arnaldo.melo@gmail.com, yuzhoujian@didichuxing.com,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 4/4] Make all print functions receive the fp argument, and opens a dump file in process_event.
Date: Tue, 3 Oct 2017 12:43:27 +0200 [thread overview]
Message-ID: <20171003104327.GB13755@krava> (raw)
In-Reply-To: <1506408797-23657-1-git-send-email-yuzhoujian@didichuxing.com>
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@krava 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
next prev parent reply other threads:[~2017-10-03 10:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-26 6:53 [PATCH v2 4/4] Make all print functions receive the fp argument, and opens a dump file in process_event yuzhoujian
2017-10-03 10:43 ` Jiri Olsa
2017-10-03 10:43 ` Jiri Olsa [this message]
2017-10-03 10:44 ` Jiri Olsa
-- strict thread matches above, loose matches on Subject: below --
2017-09-24 11:12 [PATCH v2 0/4] perf script: Add script per-event-dump support yuzhoujian
2017-09-24 11:12 ` [PATCH v2 4/4] Make all print functions receive the fp argument, and opens a dump file in process_event yuzhoujian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171003104327.GB13755@krava \
--to=jolsa@redhat.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=arnaldo.melo@gmail.com \
--cc=dsahern@gmail.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=milian.wolff@kdab.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=ufo19890607@gmail.com \
--cc=yuzhoujian@didichuxing.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox