mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Jessica Yu <jeyu@kernel.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Joel Fernandes <joelaf@google.com>
Subject: Re: ftrace: Save module init functions kallsyms symbols for tracing
Date: Tue, 10 Oct 2017 11:45:37 -0400	[thread overview]
Message-ID: <20171010114537.596e14e2@gandalf.local.home> (raw)
In-Reply-To: <20171009155100.0719ef85@gandalf.local.home>

On Mon, 9 Oct 2017 15:51:00 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:


> > Using the snd_seq example from patch 03, I get the same human-readable trace:
> > 
> > # tracer: function
> > #
> > #                              _-----=> irqs-off
> > #                             / _----=> need-resched
> > #                            | / _---=> hardirq/softirq
> > #                            || / _--=> preempt-depth
> > #                            ||| /     delay
> > #           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
> > #              | |       |   ||||       |         |
> >         modprobe-12748 [005] ....   138.964923: alsa_seq_init <-do_one_initcall
> >         modprobe-12748 [005] ....   138.964924: client_init_data <-alsa_seq_init
> >         modprobe-12748 [005] ....   138.964924: snd_sequencer_memory_init <-alsa_seq_init
> >         modprobe-12748 [005] ....   138.964924: snd_seq_queues_init <-alsa_seq_init
> >         modprobe-12748 [005] ....   138.964924: snd_sequencer_device_init <-alsa_seq_init
> >         modprobe-12748 [005] ....   138.964956: snd_seq_info_init <-alsa_seq_init
> >         modprobe-12748 [005] ....   138.964956: create_info_entry <-snd_seq_info_init
> >         modprobe-12748 [005] ....   138.964958: create_info_entry <-snd_seq_info_init
> >         modprobe-12748 [005] ....   138.964959: create_info_entry <-snd_seq_info_init
> >         modprobe-12748 [005] ....   138.964960: snd_seq_system_client_init <-alsa_seq_init
> >         modprobe-12748 [005] ....   138.964960: snd_seq_create_kernel_client <-snd_seq_system_client_init
> > 
> > In addition, the module init functions appear in /proc/kallsyms as
> > well. Thoughts? Would saving init symbol information in the module
> > symtab be sufficient for ftrace?

Hi Jessica,

Are you going to have time to work on this more?

Should we allow multiple init addresses to appear, or should there be
some check to see if they already exist, and remove the older one?

Ideally, I could have a way to know if a module init function was
traced and its address was stored in a ring buffer, and keep the init
mapping around and used for that buffer, and free it when the buffer
is cleared, and there's no other buffers that have a reference to it.
But I need to find a low overhead way to account for this.

Personally, I would rather have the mappings saved in the symbol tables
in the module code.

If we can come up with a better module way, I'll convert to that. But
as I want to get this code upstream by 4.15, I'm going to continue with
what I have.

Thoughts?

-- Steve

  reply	other threads:[~2017-10-10 15:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-19 14:28 [RFC][PATCH 0/5] tracing: Allow module init functions to be traced Steven Rostedt
2017-09-19 14:28 ` [RFC][PATCH 1/5] ftrace: Add a ftrace_free_mem() function for modules to use Steven Rostedt
2017-09-19 14:28 ` [RFC][PATCH 2/5] ftrace: Allow module init functions to be traced Steven Rostedt
2017-09-19 14:28 ` [RFC][PATCH 3/5] ftrace: Save module init functions kallsyms symbols for tracing Steven Rostedt
2017-10-06 20:55   ` Jessica Yu
2017-10-09 19:51     ` Steven Rostedt
2017-10-10 15:45       ` Steven Rostedt [this message]
2017-10-11 11:19         ` Jessica Yu
2017-10-11 13:11           ` Steven Rostedt
2017-09-19 14:28 ` [RFC][PATCH 4/5] ftrace: Add freeing algorithm to free ftrace_mod_maps Steven Rostedt
2017-09-19 14:28 ` [RFC][PATCH 5/5] ftrace/kallsyms: Have /proc/kallsyms show saved mod init functions Steven Rostedt

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=20171010114537.596e14e2@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=jeyu@kernel.org \
    --cc=joelaf@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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

all inboxes | Powered by JetHome®