mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: kan.liang@intel.com
Cc: linux-kernel@vger.kernel.org, ak@linux.intel.com, acme@kernel.org
Subject: Re: [PATCH V7 2/4] perf tools: parse the pmu event prefix and suffix
Date: Sun, 5 Oct 2014 21:02:23 +0200	[thread overview]
Message-ID: <20141005190223.GB1934@krava.redhat.com> (raw)
In-Reply-To: <1412352548-7603-3-git-send-email-kan.liang@intel.com>

On Fri, Oct 03, 2014 at 12:09:06PM -0400, kan.liang@intel.com wrote:
> From: Kan Liang <kan.liang@intel.com>

SNIP

> +/*
> + * Read the pmu events list from sysfs
> + * Save it into perf_pmu_events_list
> + */
> +static void perf_pmu__parse_init(void)
> +{
> +
> +	struct perf_pmu *pmu = NULL;
> +	struct perf_pmu_alias *alias;
> +	int len = 0;
> +
> +	pmu = perf_pmu__find("cpu");
> +	if ((pmu == NULL) || list_empty(&pmu->aliases)) {
> +		perf_pmu_events_list_num = -1;
> +		return;
> +	}
> +	list_for_each_entry(alias, &pmu->aliases, list) {
> +		if (strchr(alias->name, '-'))
> +			len++;
> +		len++;
> +	}
> +	perf_pmu_events_list = malloc(sizeof(struct perf_pmu_event_symbol) * len);
> +	perf_pmu_events_list_num = len;

missing allocation failure check

jirka

  reply	other threads:[~2014-10-05 19:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-03 16:09 [PATCH V7 0/4] perf tools: pmu event new style format fix kan.liang
2014-10-03 16:09 ` [PATCH V7 1/4] Revert "perf tools: Default to cpu// for events v5" kan.liang
2014-10-03 16:09 ` [PATCH V7 2/4] perf tools: parse the pmu event prefix and suffix kan.liang
2014-10-05 19:02   ` Jiri Olsa [this message]
2014-10-03 16:09 ` [PATCH V7 3/4] perf tools: Add support to new style format of kernel PMU event kan.liang
2014-10-03 16:09 ` [PATCH V7 4/4] perf tools: Add test case for pmu event new style format kan.liang
2014-10-05 19:08 ` [PATCH V7 0/4] perf tools: pmu event new style format fix Jiri Olsa
2014-10-06  2:42   ` Liang, Kan

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=20141005190223.GB1934@krava.redhat.com \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.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

Powered by JetHome