linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
Cc: Joel Fernandes <joel@joelfernandes.org>,
	Tom Zanussi <tom.zanussi@linux.intel.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	Vivek Gautam <vivek.gautam@codeaurora.org>,
	Prasad Sodagudi <psodagud@codeaurora.org>,
	Ingo Molnar <mingo@kernel.org>,
	tsoni@codeaurora.org, Anton Vorontsov <anton@enomsg.org>,
	Ingo Molnar <mingo@redhat.com>,
	Sibi Sankar <sibis@codeaurora.org>,
	Laura Abbott <labbott@redhat.com>,
	devicetree@vger.kernel.org, Kees Cook <keescook@chromium.org>,
	Arnd Bergmann <arnd@arndb.de>,
	linux-arm-msm@vger.kernel.org, Jason Baron <jbaron@akamai.com>,
	Rob Herring <robh+dt@kernel.org>,
	Tingwei Zhang <tingwei@codeaurora.org>,
	linux-arm-kernel@lists.infradead.org,
	Tony Luck <tony.luck@intel.com>,
	Rajendr
Subject: Re: [PATCH 3/6] tracing: Add tp_pstore cmdline to have tracepoints go to pstore
Date: Wed, 10 Oct 2018 15:37:12 -0400	[thread overview]
Message-ID: <20181010153712.4e3a16d7@gandalf.local.home> (raw)
In-Reply-To: <174a465d-aedd-6561-e4e5-1f97ca4d0b0a@codeaurora.org>

On Tue, 9 Oct 2018 23:52:14 +0530
Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org> wrote:

> >>> Also regarding the warning on "event_call->event.funcs->trace()" call,
> >>> I see it everytime without spinlock. Also we see output_printk using
> >>> spinlock when making this call. I could not find a way to pass event
> >>> buffer size and allocate in pstore. Steven can give some hints with this
> >>> I guess.  
> > 
> > The spinlock warning you're talking about is this one correct?
> > 
> > [    1.389382] WARNING: CPU: 2 PID: 2 at kernel/trace/trace_output.c:289 trace_raw_output_prep+0x18/0xa0
> > [    1.389416] Modules linked in:
> > which you reported here:
> > https://lkml.org/lkml/2018/9/22/319
> > 
> > This warning happens I think because you're trying to format the events while
> > the trace events are being generated. You said you got this warning when you
> > didn't use the spinlock. I believe the spinlocking prevents such races, but
> > if you didn't need to format the events into text into text in the first
> > place, then you wouldn't need such locking at all.
> > 
> > I believe ftrace doesn't have such issues because such locking is taken care
> > off when the trace events are formatted from the trace buffer and displayed,
> > but I could be wrong about that.. I'll let Steven provide more inputs about
> > how this warning can occur.  
> Yes Steven would have more insight on this warning.

Correct. Formatting should not be done at the location of recording
(it's way too much overhead). Even trace_printk() doesn't format string
at the execution path, but does so at the presentation path (reading
the buffer, via reads of the trace file, or in trace-cmd post
processing of the trace.dat file).

trace_printk() uses vbin_printf() which doesn't do printf()
conversions, but instead only saves the format string and the raw
values into the buffer. Then in uses bstr_printf() that takes the
format string and raw values to produce the "printf()" output you know
and love.

-- Steve

  reply	other threads:[~2018-10-10 19:37 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-08 20:27 [PATCH 0/6] Tracing register accesses with pstore and dynamic debug Sai Prakash Ranjan
2018-09-08 20:27 ` [PATCH 1/6] dt-bindings: ramoops: Add event-size property Sai Prakash Ranjan
2018-09-17  5:45   ` Rob Herring
2018-09-17 17:15     ` Sai Prakash Ranjan
2018-09-08 20:27 ` [PATCH 2/6] pstore: Add event tracing support Sai Prakash Ranjan
2018-09-11 10:46   ` Sai Prakash Ranjan
2018-09-17 17:38     ` Stephen Boyd
2018-09-17 19:43       ` Sai Prakash Ranjan
2018-09-16  7:07   ` Sai Prakash Ranjan
     [not found]     ` <CAEXW_YSPNqVgoYWjVAMvGg_WoRV4SC2xDH1wQWTdQfBUOMQbbQ@mail.gmail.com>
2018-09-17 14:54       ` Kees Cook
2018-09-17 17:17         ` Sai Prakash Ranjan
2018-09-17 17:13       ` Sai Prakash Ranjan
2018-09-17 23:04     ` Steven Rostedt
2018-09-18  6:24       ` Sai Prakash Ranjan
2018-09-17 23:34   ` Steven Rostedt
2018-09-18 17:52     ` Sai Prakash Ranjan
2018-09-18 20:44       ` Steven Rostedt
2018-09-18 21:13         ` Sai Prakash Ranjan
2018-09-22  6:48           ` Sai Prakash Ranjan
2018-09-22  9:05   ` Joel Fernandes
2018-09-22 16:37     ` Sai Prakash Ranjan
2018-09-22 17:32       ` Sai Prakash Ranjan
2018-09-22 17:45       ` Sai Prakash Ranjan
2018-09-23 15:33       ` Sai Prakash Ranjan
2018-09-25 20:37         ` Joel Fernandes
2018-09-25 20:39           ` Joel Fernandes
2018-09-25 20:40             ` Joel Fernandes
2018-09-26  9:52               ` Sai Prakash Ranjan
2018-09-08 20:27 ` [PATCH 3/6] tracing: Add tp_pstore cmdline to have tracepoints go to pstore Sai Prakash Ranjan
2018-09-25 21:25   ` Joel Fernandes
2018-09-26  9:46     ` Sai Prakash Ranjan
2018-10-08 14:16       ` Sai Prakash Ranjan
2018-10-08 14:36         ` Steven Rostedt
2018-10-08 22:40           ` Joel Fernandes
2018-10-09 18:22             ` Sai Prakash Ranjan
2018-10-10 19:37               ` Steven Rostedt [this message]
2018-09-08 20:27 ` [PATCH 4/6] arm64/io: Add tracepoint for register accesses Sai Prakash Ranjan
2018-09-08 20:27 ` [PATCH 5/6] arm64/io: Add header for instrumentation of io operations Sai Prakash Ranjan
2018-09-17 23:39   ` Steven Rostedt
2018-09-18  7:10     ` Sai Prakash Ranjan
2018-09-18 11:47       ` Will Deacon
2018-09-18 12:43         ` Sai Prakash Ranjan
2018-09-08 20:27 ` [PATCH 6/6] dynamic_debug: Add flag for dynamic event tracing Sai Prakash Ranjan
2018-09-11 15:11 ` [PATCH 0/6] Tracing register accesses with pstore and dynamic debug Will Deacon
2018-09-11 16:11   ` Sai Prakash Ranjan
2018-10-20  5:25 ` Joel Fernandes
2018-10-20  6:32   ` Sai Prakash Ranjan
2018-10-20 16:27     ` Joel Fernandes
2018-10-21  3:46       ` Sai Prakash Ranjan
2018-10-21  4:59         ` Sai Prakash Ranjan
2018-10-21  5:09         ` Joel Fernandes

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=20181010153712.4e3a16d7@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=anton@enomsg.org \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jbaron@akamai.com \
    --cc=joel@joelfernandes.org \
    --cc=keescook@chromium.org \
    --cc=labbott@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=psodagud@codeaurora.org \
    --cc=robh+dt@kernel.org \
    --cc=saiprakash.ranjan@codeaurora.org \
    --cc=sibis@codeaurora.org \
    --cc=tingwei@codeaurora.org \
    --cc=tom.zanussi@linux.intel.com \
    --cc=tony.luck@intel.com \
    --cc=tsoni@codeaurora.org \
    --cc=vivek.gautam@codeaurora.org \
    --cc=will.deacon@arm.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).