From: Steven Rostedt <rostedt@goodmis.org>
To: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
Cc: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: Re: [PATCH] trace-cmd: Suppress trace library warnings
Date: Fri, 16 Apr 2021 09:59:08 -0400 [thread overview]
Message-ID: <20210416095908.258d4c96@gandalf.local.home> (raw)
In-Reply-To: <CAPpZLN7ZvgSKoNVek+msCHarKY7F-dYUhKSuoKt_DF2qaE_rwg@mail.gmail.com>
On Fri, 16 Apr 2021 13:14:01 +0300
Tzvetomir Stoyanov <tz.stoyanov@gmail.com> wrote:
> I can fix "-q" to suppress warnings from all trace libraries, but the
> problem is that "-q" is not set by default. These "Not being able to
> parse" messages could be very annoying in some cases and as I
> understood they are not critical ? The other problem is that not all
> trace-cmd commands have the "-q" option, but almost all of them need a
> tep handler that could cause printing of these messages.
> Yodan found one more issue, the pr_stat() libtraceevent function is
> not affected by tep_vwarning() redefine. It prints statistics on
> KernelShark startup. I think we should add some kind of priorities of
> all those library messages and decide which of them when will be
> printed. It makes sense only for fatal library messages to be printed
> by default, if the "-q" option is not set. All others should be
> visible only if trace-cmd runs in debug mode.
In principle I agree, but I have mixed feelings about this, because these
messages have helped me in the past to fix something. And not that I was
debugging it. I would trace an event and this would warn on it, and then I
would know the event had issues.
But I do find that they are more annoying when it's showing too much,
especially on "-e all" runs. Personally, I would love to only show those
warnings if the record was on a subset of events, and not all of them.
Because when I specify events, and it fails to parse, then I really do care
about that.
I wonder if we should do the following:
On record, if its not "-e all" then add an option that tells report that
not all events are traced. And it will allow for showing of failed to parse
events by default, and quieted by "-q". If that option does not exist, then
only show the failed parsings if "--debug" is set.
That is, if the user specified events, they should care if they parse or
not. But if they just said "-e all" then they probably do not care, because
there's going to be events that do not parse.
Thoughts?
As for pr_stat(), I think we should rename it to tep_info() and tep_vinfo()
that acts just like tep_warning(), except it is for informational output
(stdout instead of stderr). This is similar to what the kernel has.
Since tep_vwarning() takes a name, so can tep_vinfo(), and I was thinking
that we should expose this string to the application.
extern const char *tep_name;
As well for libtracefs:
extern const char *tracefs_name;
Then in tep_warning(), we could do things like:
if (name == tep_name) {
/* do something for libtraceevent errors */
} else if (name == tracefs_name) {
/* do something for libtracefs errors */
}
Instead of doing the error prone:
if (!strcmp(name, "libtraceevent")) {
[..]
} else if (!strcmp(name, "libtracefs")) {
[..]
}
-- Steve
next prev parent reply other threads:[~2021-04-16 13:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-15 8:03 [PATCH] trace-cmd: Suppress trace library warnings Tzvetomir Stoyanov (VMware)
2021-04-15 13:34 ` Steven Rostedt
2021-04-16 10:14 ` Tzvetomir Stoyanov
2021-04-16 13:59 ` Steven Rostedt [this message]
2021-04-16 14:01 ` Steven Rostedt
2021-04-22 20:25 ` Steven Rostedt
2021-04-28 7:51 ` Tzvetomir Stoyanov
-- strict thread matches above, loose matches on Subject: below --
2021-04-15 8:15 [PATCH 0/3] Fix overflow when applying tsc2nsec calculations Tzvetomir Stoyanov (VMware)
2021-04-15 8:15 ` [PATCH] trace-cmd: Suppress trace library warnings Tzvetomir Stoyanov (VMware)
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=20210416095908.258d4c96@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=tz.stoyanov@gmail.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).