linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Doug Anderson <dianders@chromium.org>
Cc: Daniel Thompson <daniel.thompson@linaro.org>,
	Ingo Molnar <mingo@redhat.com>,
	Jason Wessel <jason.wessel@windriver.com>,
	kgdb-bugreport@lists.sourceforge.net,
	Brian Norris <briannorris@chromium.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v5 2/3] tracing: Add trace_total_entries() / trace_total_entries_cpu()
Date: Tue, 19 Mar 2019 10:55:25 -0400	[thread overview]
Message-ID: <20190319105525.7686763b@gandalf.local.home> (raw)
In-Reply-To: <CAD=FV=UJNED79Oc3ge3_JXZdJcADm_B9N-asymGrwZvKew2Wzw@mail.gmail.com>

On Tue, 19 Mar 2019 07:45:38 -0700
Doug Anderson <dianders@chromium.org> wrote:

> > > +unsigned long trace_total_entries_cpu(struct trace_array *tr, int cpu)
> > > +{
> > > +     unsigned long total, entries;
> > > +
> > > +     if (!tr)
> > > +             tr = &global_trace;  
> >
> > This function is only ever called with tr set to NULL which means tr is
> > an argument looking for a user.
> >
> > I wouldn't mind except if this was following copying prior art to keep
> > the API feel the same but I can't find any other trace function where
> > the trace_array can be substituted for NULL. AFAICT all the existing
> > sites where global_trace is used will use it unconditionally.  

I'm in the process of making everything work better with tracing
instances. Which means, making all the APIs use the tr pointer (which is
the descriptor for the instance).

All new APIs added to the tracing infrastructure should reference a "tr"
pointer, and not use the global_trace directly. We can default it if tr
is NULL.

There are currently lots of cases in the code that do so, but I'm
trying to get rid of them.

> 
> Happy to change this if you guys want.  At the moment the
> trace_total_entries() comes straight from Steven's suggestion at:
> 
> https://lkml.kernel.org/r/20190315144130.1aa36931@gandalf.local.home
> 
> Ugh, but while looking at this it looks like I totally forgot one
> piece of feedback from Steven: to move the disabling of the tracing
> out so it's not re-enabled after counting but before dumping.  Not
> sure how I missed that.  :(
> 
> I'll wait to spin until I hear from Steven if he wants me to remove
> the "struct trace_array *tr" argument, then I'll post out a v6 with
> the fix I forgot...

Please keep the tr argument.

Thanks!

-- Steve

  reply	other threads:[~2019-03-19 14:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-18 20:47 [PATCH v5 1/3] tracing: kdb: The skip_lines parameter should have been skip_entries Douglas Anderson
2019-03-18 20:47 ` [PATCH v5 2/3] tracing: Add trace_total_entries() / trace_total_entries_cpu() Douglas Anderson
2019-03-18 21:18   ` Steven Rostedt
2019-03-19 11:30     ` Daniel Thompson
2019-03-19 11:25   ` Daniel Thompson
2019-03-19 14:45     ` Doug Anderson
2019-03-19 14:55       ` Steven Rostedt [this message]
2019-03-19 15:56         ` Daniel Thompson
2019-03-18 20:47 ` [PATCH v5 3/3] tracing: kdb: Allow ftdump to skip all but the last few entries Douglas Anderson
2019-03-18 21:18 ` [PATCH v5 1/3] tracing: kdb: The skip_lines parameter should have been skip_entries Steven Rostedt

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=20190319105525.7686763b@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=briannorris@chromium.org \
    --cc=daniel.thompson@linaro.org \
    --cc=dianders@chromium.org \
    --cc=jason.wessel@windriver.com \
    --cc=kgdb-bugreport@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.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;
as well as URLs for NNTP newsgroup(s).