All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arun Easi <aeasi@marvell.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Daniel Wagner <dwagner@suse.de>,
	Nilesh Javali <njavali@marvell.com>, <martin.petersen@oracle.com>,
	<linux-scsi@vger.kernel.org>,
	<GR-QLogic-Storage-Upstream@marvell.com>, <bhazarika@marvell.com>,
	<agurumurthy@marvell.com>
Subject: Re: [EXT] Re: [PATCH 2/6] qla2xxx: Add a generic tracing framework
Date: Tue, 19 Jul 2022 14:06:11 -0700	[thread overview]
Message-ID: <259d53a5-958e-6508-4e45-74dba2821242@marvell.com> (raw)
In-Reply-To: <20220718152243.21ad13e7@gandalf.local.home>

[-- Attachment #1: Type: text/plain, Size: 3074 bytes --]

On Mon, 18 Jul 2022, 12:22pm, Steven Rostedt wrote:

> External Email
> 
> ----------------------------------------------------------------------
> On Mon, 18 Jul 2022 12:02:26 -0700
> Arun Easi <aeasi@marvell.com> wrote:
> 
> > Many times when a problem was reported on the driver, we had to request 
> > for a repro with extended error logging (via driver module parameter) 
> > turned on. With this internal tracing in place, log messages that appear 
> > only with extended error logging are captured by default in the internal 
> > trace buffer.
> > 
> > AFAIK, kernel tracing requires a user initiated action to be turned on, 
> > like enabling individual tracepoints. Though a script (either startup or 
> > udev) can do this job, enabling tracepoints by default for a single 
> > driver, I think, may not be a preferred choice -- particularly when the 
> > trace buffer is shared across the kernel. That also brings the extra 
> > overhead of finding how this could be done across various distros.
> > 
> > For cases where the memory/driver size matters, there is an option to 
> > compile out this feature, plus choosing a lower default trace buffer size.
> 
> You can enable an ftrace instance from inside the kernel, and make it a
> compile time option.
> 
> 	#include <linux/trace_events.h>
> 	#include <linux/trace.h>
> 
> 	struct trace_array *tr;
> 
> 	tr = trace_array_get_by_name("qla2xxx");
> 	trace_array_set_clr_event(tr, "qla", NULL, true);
> 
> And now you have trace events running:
> 
>  # cat /sys/kernel/tracing/instances/qla/trace
> 

Thanks Steve. I was not aware of this relatively newer interface. This 
looks promising.

I have a question on the behavior of this interface.

It appears by calling the above two interfaces, I get a separate instance 
of "qla" only traces, but with only the "qla"-only instance being enabled, 
leaving the main (/sys/kernel/tracing/events/qla/enable) one disabled. No 
issues there, but when I enable both of them, I get garbage values on one.

/sys/kernel/tracing/instances/qla2xxx/trace:
             cat-56106   [012] ..... 2419873.470098: ql_dbg_log: qla2xxx [0000:05:00.0]-1054:14:  Entered (null).
             cat-56106   [012] ..... 2419873.470101: ql_dbg_log: qla2xxx [0000:05:00.0]-1000:14:  Entered ×+<96>²Ü<98>^H.
             cat-56106   [012] ..... 2419873.470102: ql_dbg_log: qla2xxx [0000:05:00.0]-1006:14:  Prepare to issue mbox cmd=0xde589000.

/sys/kernel/tracing/trace:
             cat-56106   [012] ..... 2419873.470097: ql_dbg_log: qla2xxx [0000:05:00.0]-1054:14:  Entered qla2x00_get_firmware_state.
             cat-56106   [012] ..... 2419873.470100: ql_dbg_log: qla2xxx [0000:05:00.0]-1000:14:  Entered qla2x00_mailbox_command.
             cat-56106   [012] ..... 2419873.470102: ql_dbg_log: qla2xxx [0000:05:00.0]-1006:14:  Prepare to issue mbox cmd=0x69.

It appears that only one should be enabled at a time. Per my read of 
Documentation/trace/ftrace.rst, the main directory and instances have 
separate trace buffers, so I am a bit confused with the above output.

Regards,
-Arun

  parent reply	other threads:[~2022-07-19 21:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15  6:02 [PATCH 0/6] qla2xxx driver features Nilesh Javali
2022-07-15  6:02 ` [PATCH 1/6] qla2xxx: Add debugfs create/delete helpers Nilesh Javali
2022-07-15  6:02 ` [PATCH 2/6] qla2xxx: Add a generic tracing framework Nilesh Javali
2022-07-18  8:54   ` Daniel Wagner
2022-07-18 19:02     ` Arun Easi
2022-07-18 19:22       ` Steven Rostedt
2022-07-19  8:25         ` Daniel Wagner
2022-07-19 13:05           ` Steven Rostedt
2022-07-19 22:09           ` [EXT] " Arun Easi
2022-07-23  7:47             ` Steffen Maier
2022-07-25 13:56               ` Steven Rostedt
2022-07-19 21:06         ` Arun Easi [this message]
2022-07-19 21:40           ` Steven Rostedt
2022-07-19 22:09             ` Arun Easi
2022-07-19 22:17               ` Steven Rostedt
2022-07-20  4:43   ` kernel test robot
2022-07-15  6:02 ` [PATCH 3/6] qla2xxx: Add driver console messages tracing Nilesh Javali
2022-07-15  6:02 ` [PATCH 4/6] qla2xxx: Add srb tracing Nilesh Javali
2022-07-15  6:02 ` [PATCH 5/6] qla2xxx: Add NVMe parameters support in Auxiliary Image Status Nilesh Javali
2022-07-15  6:02 ` [PATCH 6/6] qla2xxx: Update version to 10.02.07.900-k Nilesh Javali

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=259d53a5-958e-6508-4e45-74dba2821242@marvell.com \
    --to=aeasi@marvell.com \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --cc=agurumurthy@marvell.com \
    --cc=bhazarika@marvell.com \
    --cc=dwagner@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=njavali@marvell.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.