public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Jiri Olsa <jolsa@redhat.com>
Cc: linux-kernel@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Corey Ashford <cjashfor@linux.vnet.ibm.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@elte.hu>, Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Andi Kleen <andi@firstfloor.org>,
	Ulrich Drepper <drepper@gmail.com>,
	Will Deacon <will.deacon@arm.com>,
	Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH 6/8] perf tests: Add automated tests for formula object
Date: Fri, 03 May 2013 09:18:05 -0600	[thread overview]
Message-ID: <5183D52D.7060303@gmail.com> (raw)
In-Reply-To: <1367421346-18257-7-git-send-email-jolsa@redhat.com>

On 5/1/13 9:15 AM, Jiri Olsa wrote:
> +static int __test_basics(char *file)
> +{
> +	struct perf_formula fml;
> +	struct perf_formula_set *set;
> +	struct perf_formula_counter *counter;
> +	struct perf_evlist *evlist;
> +	struct perf_evsel *evsel;
> +	struct perf_counts *counts;
> +	struct perf_formula_expr expr;
> +	int ret;
> +
> +	pr_debug("file %s\n", file);
> +
> +	perf_formula__init(&fml);
> +
> +	ret = perf_formula__load(&fml, file);
> +	TEST_ASSERT_VAL("failed to load formula", !ret);

With all the asserts when something goes wrong you should delete the 
file right after perf_formula__load. so maybe

file = file_get(data, sizeof(data));
ret = perf_formula__load(&fml, file);
file_put(file);

David

  reply	other threads:[~2013-05-03 15:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-01 15:15 [RFCv2 0/8] perf tools: Adding formula support Jiri Olsa
2013-05-01 15:15 ` [PATCH 1/8] perf tools: Move start conditions to start of the flex file Jiri Olsa
2013-05-01 15:15 ` [PATCH 2/8] perf tools: Factorize event parsing to be more general Jiri Olsa
2013-05-01 15:15 ` [PATCH 3/8] perf tools: Add formula-* parsing support for events Jiri Olsa
2013-05-03 15:07   ` David Ahern
2013-05-06 17:47     ` Jiri Olsa
2013-05-01 15:15 ` [PATCH 4/8] perf tools: Add formula interface to interface formula definitions Jiri Olsa
2013-05-15  9:13   ` Peter Zijlstra
2013-05-01 15:15 ` [PATCH 5/8] perf tools: Add support to preload default formulas Jiri Olsa
2013-05-03 15:11   ` David Ahern
2013-05-06 17:48     ` Jiri Olsa
2013-05-01 15:15 ` [PATCH 6/8] perf tests: Add automated tests for formula object Jiri Olsa
2013-05-03 15:18   ` David Ahern [this message]
2013-05-06 17:54     ` Jiri Olsa
2013-05-06 18:08       ` David Ahern
2013-05-01 15:15 ` [PATCH 7/8] perf stat: Add support to process formulas Jiri Olsa
2013-05-01 15:15 ` [PATCH 8/8] perf list: List formulas counters Jiri Olsa
2013-05-06 17:44 ` [RFCv2 0/8] perf tools: Adding formula support Jiri Olsa

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=5183D52D.7060303@gmail.com \
    --to=dsahern@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=andi@firstfloor.org \
    --cc=cjashfor@linux.vnet.ibm.com \
    --cc=drepper@gmail.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    --cc=will.deacon@arm.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