From: Namhyung Kim <namhyung@kernel.org>
To: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
Cc: linux-kernel@vger.kernel.org,
Steven Rostedt <rostedt@goodmis.org>,
Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Ingo Molnar <mingo@redhat.com>,
yrl.pp-manager.tt@hitachi.com
Subject: Re: [PATCH -tip RESEND 2/2] ftrace: Introduce nr_saved_cmdlines I/F
Date: Fri, 14 Feb 2014 13:50:30 +0900 [thread overview]
Message-ID: <878utez4a1.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <20140213012858.15283.93302.stgit@yunodevel> (Yoshihiro YUNOMAE's message of "Thu, 13 Feb 2014 10:28:58 +0900")
Hi Yoshihiro,
On Thu, 13 Feb 2014 10:28:58 +0900, Yoshihiro YUNOMAE wrote:
> Introduce nr_saved_cmdlines I/F for changing the number of pid-comm list.
> saved_cmdlines can store 128 command names using SAVED_CMDLINES now, but
> 'no-existing processes' names are often lost in saved_cmdlines when we
> read trace data. So, by introducing nr_saved_cmdlines I/F, the rule storing
> 128 command names is changed to the command numbers defined users.
>
> When we write a value to nr_saved_cmdlines, the number of the value will
> be stored in pid-comm list:
>
> # echo 1024 > /sys/kernel/debug/tracing/nr_saved_cmdlines
>
> Here, 1024 command names are stored. The default number is 128 and the maximum
> number is PID_MAX_DEFAULT (=32768 if CONFIG_BASE_SMALL is not set). So, if we
> want to avoid to lose command names, we need to set 32768 to nr_saved_cmdlines.
>
> We can read the maximum number of the list:
>
> # cat /sys/kernel/debug/tracing/nr_saved_cmdlines
> 128
[SNIP]
> @@ -3685,7 +3760,8 @@ static void *saved_cmdlines_next(struct seq_file *m, void *v, loff_t *pos)
>
> (*pos)++;
>
> - for (; ptr < &map_cmdline_to_pid[SAVED_CMDLINES]; ptr++) {
> + for (; ptr < &savedcmd->map_cmdline_to_pid[savedcmd->cmdline_num];
> + ptr++) {
> if (*ptr == -1 || *ptr == NO_CMDLINE_MAP)
> continue;
>
> @@ -3700,7 +3776,7 @@ static void *saved_cmdlines_start(struct seq_file *m, loff_t *pos)
> void *v;
> loff_t l = 0;
>
> - v = &map_cmdline_to_pid[0];
> + v = &savedcmd->map_cmdline_to_pid[0];
> while (l <= *pos) {
> v = saved_cmdlines_next(m, v, &l);
> if (!v)
Are you accessing the savecmd without trace_cmdline_lock?
Thanks,
Namhyung
next prev parent reply other threads:[~2014-02-14 4:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-13 1:28 [PATCH -tip RESEND 0/2] ftrace: Introduce the new I/F "nr_saved_cmdlines" Yoshihiro YUNOMAE
2014-02-13 1:28 ` [PATCH -tip RESEND 1/2] ftrace: Make saved_cmdlines use seq_read Yoshihiro YUNOMAE
2014-02-13 1:28 ` [PATCH -tip RESEND 2/2] ftrace: Introduce nr_saved_cmdlines I/F Yoshihiro YUNOMAE
2014-02-14 4:50 ` Namhyung Kim [this message]
2014-02-17 4:57 ` Yoshihiro YUNOMAE
2014-02-17 7:13 ` Namhyung Kim
2014-02-18 1:41 ` Yoshihiro YUNOMAE
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=878utez4a1.fsf@sejong.aot.lge.com \
--to=namhyung@kernel.org \
--cc=fweisbec@gmail.com \
--cc=hidehiro.kawai.ez@hitachi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=yoshihiro.yunomae.ez@hitachi.com \
--cc=yrl.pp-manager.tt@hitachi.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