linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tzvetomir Stoyanov <tstoyanov@vmware.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: "linux-trace-devel@vger.kernel.org"  <linux-trace-devel@vger.kernel.org>
Subject: Re: [PATCH 1/2] trace-cmd: remove parsing_failures APIs from libtraceevent
Date: Wed, 17 Apr 2019 09:10:26 +0000	[thread overview]
Message-ID: <CACqStoc1vyLp=8XavFoXBCrFQh7C5eruhhGoVLwqHS670TP06g@mail.gmail.com> (raw)
In-Reply-To: <20190416184832.2bb69162@gandalf.local.home>

Hi Steven,

On Wed, Apr 17, 2019 at 1:48 AM Steven Rostedt <rostedt@goodmis.org> wrote:
>
....
> > +/**
> > + * tracecmd_read_headers_failures - read the header information from trace.dat
> > + * @handle: input handle for the trace.dat file
> > + * @parsing_failures: return number of failures while parsing the event files
> > + *
> > + * This reads the trace.dat file for various information. Like the
> > + * format of the ring buffer, event formats, ftrace formats, kallsyms
> > + * and printk.
> > + */
> > +int tracecmd_read_headers_failures(struct tracecmd_input *handle,
> > +                                int *parsing_failures)
>
> Let's not add this. Instead add a "parsing_failures" to the
> tracecmd_input handle, and add:
>
> int tracecmd_get_parsing_failures(struct tracecmd_input *handle)
> {
>         return handle->parsing_failures;
> }
>
I hesitated if to add new API, or use additional parameter to the
existing functions.
The reason for this change is to remove "parsing_failures" from
traceevent library,
that's why I decided not to move it to trace-cmd library. Using new
library API is nicer,
I can reimplement it in this way, but we may have the same concerns
when trace-cmd
library comes out.

> > +{
> > +     return _tracecmd_read_headers(handle, parsing_failures);
> > +}
> > +
>
> [..]
>
> > diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c
> > index 52fa1bd..fe116cc 100644
> > --- a/tracecmd/trace-read.c
> > +++ b/tracecmd/trace-read.c
> > @@ -1417,6 +1417,7 @@ void trace_report (int argc, char **argv)
> >       unsigned long long tsoffset = 0;
> >       unsigned long long ts2secs = 0;
> >       unsigned long long ts2sc;
> > +     int parsing_failures;
> >       int show_stat = 0;
> >       int show_funcs = 0;
> >       int show_endian = 0;
> > @@ -1714,10 +1715,10 @@ void trace_report (int argc, char **argv)
> >                       tracecmd_print_events(handle, print_event);
> >                       return;
> >               }
> > -
> > -             ret = tracecmd_read_headers(handle);
> > +             parsing_failures = 0;
> > +             ret = tracecmd_read_headers_failures(handle, &parsing_failures);
>
> Here we should do:
>
>                 ret = tracecmd_read_headers(handle);
>
> >               if (check_event_parsing) {
> > -                     if (ret || tep_get_parsing_failures(pevent))
>
>                         if (ret || tracecmd_get_parsing_failures(handle))
>
> -- Steve
>
> > +                     if (ret || parsing_failures)
> >                               exit(EINVAL);
> >                       else
> >                               exit(0);
>


-- 

Tzvetomir (Ceco) Stoyanov
VMware Open Source Technology Center

  reply	other threads:[~2019-04-17  9:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-15 12:58 [PATCH 1/2] trace-cmd: remove parsing_failures APIs from libtraceevent Tzvetomir Stoyanov
2019-04-15 12:58 ` [PATCH 2/2] trace-cmd: exit the application if runs in "filter test" mode Tzvetomir Stoyanov
2019-04-16 22:48 ` [PATCH 1/2] trace-cmd: remove parsing_failures APIs from libtraceevent Steven Rostedt
2019-04-17  9:10   ` Tzvetomir Stoyanov [this message]
2019-04-17 13:19     ` Steven Rostedt
2019-04-17 13:55       ` Tzvetomir Stoyanov

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='CACqStoc1vyLp=8XavFoXBCrFQh7C5eruhhGoVLwqHS670TP06g@mail.gmail.com' \
    --to=tstoyanov@vmware.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /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;
as well as URLs for NNTP newsgroup(s).