From: Jiri Olsa <jolsa@redhat.com>
To: "Jin, Yao" <yao.jin@linux.intel.com>
Cc: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org,
mingo@redhat.com, alexander.shishkin@linux.intel.com,
Linux-kernel@vger.kernel.org, ak@linux.intel.com,
kan.liang@intel.com, yao.jin@intel.com
Subject: Re: [PATCH v3 1/6] perf header: Record first sample time and last sample time in perf file header
Date: Mon, 2 Oct 2017 16:15:10 +0200 [thread overview]
Message-ID: <20171002141510.GA24613@krava> (raw)
In-Reply-To: <2e7c593d-48e1-414c-9132-52fcdc0311f7@linux.intel.com>
On Mon, Oct 02, 2017 at 09:48:31PM +0800, Jin, Yao wrote:
>
>
> On 10/2/2017 9:00 PM, Jiri Olsa wrote:
> > On Mon, Oct 02, 2017 at 08:52:59PM +0800, Jin, Yao wrote:
> >>
> >>
> >> On 10/2/2017 7:50 PM, Jiri Olsa wrote:
> >>> On Thu, Sep 28, 2017 at 08:45:16PM +0800, Jin Yao wrote:
> >>>
> >>> SNIP
> >>>
> >>>> + return ret;
> >>>> +
> >>>> + return do_write(ff, &evlist->last_sample_time,
> >>>> + sizeof(evlist->last_sample_time));
> >>>> +}
> >>>> +
> >>>> static void print_hostname(struct feat_fd *ff, FILE *fp)
> >>>> {
> >>>> fprintf(fp, "# hostname : %s\n", ff->ph->env.hostname);
> >>>> @@ -1506,6 +1520,19 @@ static void print_group_desc(struct feat_fd *ff, FILE *fp)
> >>>> }
> >>>> }
> >>>>
> >>>> +static void print_sample_time(struct feat_fd *ff, FILE *fp)
> >>>> +{
> >>>> + struct perf_session *session;
> >>>> +
> >>>> + session = container_of(ff->ph, struct perf_session, header);
> >>>> +
> >>>> + fprintf(fp, "# time of first sample : %" PRIu64 "\n",
> >>>> + session->evlist->first_sample_time);
> >>>> +
> >>>> + fprintf(fp, "# time of last sample : %" PRIu64 "\n",
> >>>> + session->evlist->last_sample_time);
> >>>
> >>> this could be done in some follow up patch, but could we
> >>> display this in some human readable way..
> >>>
> >>> # time of first sample : 218077073264620
> >>> # time of last sample : 218077073395488
> >>>
> >>> jirka
> >>>
> >>
> >> Could I add the printing of duration? For example,
> >>
> >> duration = (double)(last_sample_time - first_sample_time) / NSEC_PER_MSEC;
> >> fprintf(fp, "# sample duration: %10.3f (ms)\n", duration);
> >>
> >> fprintf(fp, "# time of first sample : %" PRIu64 "\n",
> >> first_sample_time);
> >>
> >> fprintf(fp, "# time of last sample : %" PRIu64 "\n",
> >> last_sample_time);
> >
> > could be, but mainly please display the time same way the perf script does:
> >
> > 218482.819815
> >
> > jirka
> >
>
> Fine. I think I can use timestamp__scnprintf_usec() to print the timestamp.
>
> BTW, do we need the duration printing here?
yea, might be helpful
thanks,
jirka
next prev parent reply other threads:[~2017-10-02 14:15 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-28 12:45 [PATCH v3 0/6] perf report/script: Support percent and multiple range in --time option Jin Yao
2017-09-28 12:45 ` [PATCH v3 1/6] perf header: Record first sample time and last sample time in perf file header Jin Yao
2017-10-02 11:50 ` Jiri Olsa
2017-10-02 12:52 ` Jin, Yao
2017-10-02 13:00 ` Jiri Olsa
2017-10-02 13:48 ` Jin, Yao
2017-10-02 14:15 ` Jiri Olsa [this message]
2017-09-28 12:45 ` [PATCH v3 2/6] perf record: Get the first sample time and last sample time Jin Yao
2017-09-28 12:45 ` [PATCH v3 3/6] perf util: Create function to parse time percent Jin Yao
2017-09-28 12:45 ` [PATCH v3 4/6] perf util: Create function to perform multiple time range checking Jin Yao
2017-09-28 12:45 ` [PATCH v3 5/6] perf report: support time percent and multiple time ranges Jin Yao
2017-10-02 11:52 ` Jiri Olsa
2017-10-02 12:57 ` Jin, Yao
2017-09-28 12:45 ` [PATCH v3 6/6] perf script: " Jin Yao
2017-10-02 11:58 ` Jiri Olsa
2017-10-02 13:41 ` Jin, Yao
2017-10-02 14:21 ` Jiri Olsa
2017-10-02 14:28 ` Jin, Yao
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=20171002141510.GA24613@krava \
--to=jolsa@redhat.com \
--cc=Linux-kernel@vger.kernel.org \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@intel.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=yao.jin@intel.com \
--cc=yao.jin@linux.intel.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