public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Jean-Michel Hautbois <jeanmichel.hautbois@yoseli.org>
Cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Greg Ungerer <gerg@linux-m68k.org>,
	Tomas Glozar <tglozar@redhat.com>
Subject: Re: [PATCH RFC 0/2] Add basic tracing support for m68k
Date: Tue, 19 Nov 2024 13:10:35 -0500	[thread overview]
Message-ID: <20241119131035.3c42a533@gandalf.local.home> (raw)
In-Reply-To: <e4456cb1-b1bc-453b-b3b5-3ee4f03995be@yoseli.org>

On Tue, 19 Nov 2024 19:06:45 +0100
Jean-Michel Hautbois <jeanmichel.hautbois@yoseli.org> wrote:
> > 
> > It shouldn't crash, but it also found a bug in your code ;-)  
> 
> In my code is a really big assumption :-).

Well, not your personally, but I meant "your" as in m68k code.

> 
> > You reference two variables that are not part of the event:
> > 
> >   "mem_map" and "m68k_memory[0].addr"
> > 
> > Do these variables ever change? Because the TP_printk() part of the
> > TRACE_EVENT() macro is called a long time after the event is recorded. It
> > could be seconds, minutes, days or even months (and unlikely possibly
> > years) later.  
> 
> I am really not the best placed to answer.
> AFAIK, it sounds like those are never changing.

That would mean they are OK and will not corrupt the trace, but it will be
meaningless for tools like perf and trace-cmd.

> 
> > 
> > The event takes place and runs the TP_fast_assign() to record the event in
> > the ring buffer. Then some time later, when you read the "trace" file, the
> > TP_printk() portion gets run. If you wait months before reading that, it is
> > executed months later.
> > 
> > Now you have "mem_map" and "m68k_memory[0].addr" in that output that gets
> > run months after the fact. Are they constant throughout the boot?  
> 
> I don't know.
> 
> > Now another issue is that user space has no idea what those values are. Now
> > user space can not print the values. Currently the code crashes because you
> > are the first one to reference a global value from a trace event print fmt.
> > That should probably be fixed to simply fail to parse the event and ignore
> > the print format logic (which defaults to just printing the raw fields).  
> 
> The patch you sent works...
> But, it fails a bit later:
> Dispatching timerlat u procs
> starting loop
> User-space timerlat pid 230 on cpu 0
> Segmentation fault
> 

More printk? ;-)

-- Steve

  reply	other threads:[~2024-11-19 18:10 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-21  9:44 [PATCH RFC 0/2] Add basic tracing support for m68k Jean-Michel Hautbois
2024-10-21  9:44 ` [PATCH RFC 1/2] m68k: Add tracirqs Jean-Michel Hautbois
2024-10-22  5:28   ` Steven Rostedt
2024-10-22  5:42     ` Jean-Michel Hautbois
2024-10-22  8:30       ` Steven Rostedt
2024-10-22  9:21         ` Jean-Michel Hautbois
2024-10-23  8:47           ` Steven Rostedt
2024-10-23  9:07             ` Jean-Michel Hautbois
2024-10-23  9:13               ` Geert Uytterhoeven
2024-10-23  9:31                 ` Jean-Michel Hautbois
2024-10-23 10:30                   ` Jean-Michel Hautbois
2024-10-23  3:53   ` Michael Schmitz
2024-10-23  5:53     ` Jean-Michel Hautbois
2024-10-23  7:30       ` Michael Schmitz
2024-10-23  8:59         ` Jean-Michel Hautbois
2024-10-23  9:27           ` Steven Rostedt
2024-10-23  8:51       ` Eero Tamminen
2024-10-21  9:44 ` [PATCH RFC 2/2] arch: m68k: Add STACKTRACE support Jean-Michel Hautbois
2024-11-15  8:26 ` [PATCH RFC 0/2] Add basic tracing support for m68k Jean-Michel Hautbois
2024-11-15 15:25   ` Steven Rostedt
2024-11-15 15:33     ` Jean-Michel Hautbois
2024-11-15 19:55       ` Steven Rostedt
2024-11-18 10:11         ` Jean-Michel Hautbois
2024-11-18 20:20           ` Steven Rostedt
2024-11-19 14:24             ` Jean-Michel Hautbois
2024-11-19 15:26               ` Steven Rostedt
2024-11-19 16:28                 ` Steven Rostedt
2024-11-19 16:44                   ` Steven Rostedt
2024-11-19 18:06                   ` Jean-Michel Hautbois
2024-11-19 18:10                     ` Steven Rostedt [this message]
2024-11-20 11:47                       ` Jean-Michel Hautbois
2024-11-19 18:25                     ` Michael Schmitz

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=20241119131035.3c42a533@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=geert@linux-m68k.org \
    --cc=gerg@linux-m68k.org \
    --cc=jeanmichel.hautbois@yoseli.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=tglozar@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