From: Andi Kleen <ak@linux.intel.com>
To: kan.liang@intel.com
Cc: acme@kernel.org, jolsa@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2 2/3] perf tools: parse the pmu event prefix and surfix
Date: Wed, 27 Aug 2014 09:22:46 -0700 [thread overview]
Message-ID: <20140827162246.GH5803@tassilo.jf.intel.com> (raw)
In-Reply-To: <1409106792-22333-2-git-send-email-kan.liang@intel.com>
> + while ((pmu = perf_pmu__scan(pmu)) != NULL)
> + list_for_each_entry(alias, &pmu->aliases, list) {
> + if (!strcmp(pmu->name, "cpu")) {
> + struct kernel_pmu_event_symbol *p =
> + kernel_pmu_events_list + len;
> + char *tmp = strchr(alias->name, '-');
> +
> + if (tmp != NULL) {
> + strncpy(p->symbol, alias->name,
> + tmp - alias->name);
Please use strlcpy(). Otherwise p->symbol may not be zero terminated.
The rest of the patch looks good to me.
-Andi
next prev parent reply other threads:[~2014-08-27 16:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-27 2:33 [PATCH V2 1/3] Revert "perf tools: Default to cpu// for events v5" kan.liang
2014-08-27 2:33 ` [PATCH V2 2/3] perf tools: parse the pmu event prefix and surfix kan.liang
2014-08-27 16:22 ` Andi Kleen [this message]
2014-08-27 2:33 ` [PATCH V2 3/3] perf tools: Add support to new style format of kernel PMU event kan.liang
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=20140827162246.GH5803@tassilo.jf.intel.com \
--to=ak@linux.intel.com \
--cc=acme@kernel.org \
--cc=jolsa@redhat.com \
--cc=kan.liang@intel.com \
--cc=linux-kernel@vger.kernel.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