public inbox for linux-scsi@vger.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 15:09:30 -0700	[thread overview]
Message-ID: <782837dd-5eb2-c7dd-7cc1-25ca97806830@marvell.com> (raw)
In-Reply-To: <20220719174056.56d39d87@gandalf.local.home>

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

On Tue, 19 Jul 2022, 2:40pm, Steven Rostedt wrote:

> On Tue, 19 Jul 2022 14:06:11 -0700
> Arun Easi <aeasi@marvell.com> wrote:
> 
> > 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.
> 
> That's because it uses va_list, and va_list can only be used once.

Ah, that makes sense.

> 
> I just added helpers for va_list use cases:
> 
>    https://urldefense.proofpoint.com/v2/url?u=https-3A__lore.kernel.org_all_20220705224453.120955146-40goodmis.org_&d=DwIFaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=P-q_Qkt75qFy33SvdD2nAxAyN87eO1d-mFO-lqNOomw&m=cDBXba_lNDGk7c1Qm4elDe1Co-RV8zR-c1A9xV7vc4nMcQO7iRle72qNxljHsDNA&s=74PzgMj6nmfRCLXd3oMIqt-_DZbQeukUl0nK7MzfUjs&e= 
> 
> But it will likely suffer the same issue, but I can easily fix that with
> this on top:
> 
> Not even compiled tested:
> 
> -- Steve
> 
> diff --git a/include/trace/stages/stage6_event_callback.h b/include/trace/stages/stage6_event_callback.h
> index 0f51f6b3ab70..3c554a585320 100644
> --- a/include/trace/stages/stage6_event_callback.h
> +++ b/include/trace/stages/stage6_event_callback.h
> @@ -40,7 +40,12 @@
>  
>  #undef __assign_vstr
>  #define __assign_vstr(dst, fmt, va)					\
> -	vsnprintf(__get_str(dst), TRACE_EVENT_STR_MAX, fmt, *(va))
> +	do {								\
> +		va_list __cp_va;					\
> +		va_copy(__cp_va, *(va));				\
> +		vsnprintf(__get_str(dst), TRACE_EVENT_STR_MAX, fmt, __cp_va); \
> +		va_end(__cp_va);					\
> +	} while (0)
>  
>  #undef __bitmask
>  #define __bitmask(item, nr_bits) __dynamic_array(unsigned long, item, -1)
> 

This will be nice.

Thanks for your help, Steve.

Regards,
-Arun

  reply	other threads:[~2022-07-19 22:10 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
2022-07-19 21:40           ` Steven Rostedt
2022-07-19 22:09             ` Arun Easi [this message]
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=782837dd-5eb2-c7dd-7cc1-25ca97806830@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox