Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1220124

Re: [PATCH 2/3] perf tests: Add arch tests

From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/3] perf tests: Add arch tests
Date 2015-09-07 14:30 +0200
Message-ID <q63ID-5sL-37@gated-at.bofh.it> (permalink)
References <q5r0C-Ua-3@gated-at.bofh.it> <q5r0C-Ua-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, Sep 05, 2015 at 08:02:21PM +0100, Matt Fleming wrote:

SNIP

>  };
>  
> +static struct test *tests[] = {
> +	generic_tests,
> +	arch_tests,
> +};
> +
>  static bool perf_test__matches(struct test *test, int curr, int argc, const char *argv[])
>  {
>  	int i;
> @@ -237,7 +229,11 @@ static int run_test(struct test *test)
>  	return err;
>  }
>  
> -#define for_each_test(t)	 for (t = &tests[0]; t->func; t++)
> +static unsigned int ___j;		/* This is obviously not thread-safe */
> +
> +#define for_each_test(t)	 				\
> +	for (___j = 0; ___j < ARRAY_SIZE(tests); ___j++)	\
> +		for (t = &tests[___j][0]; t->func; t++)

why not have ____j on stack and pas it into for_each_test

for_each_test(j, t)                                     
...

jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 2/3] perf tests: Add arch tests Matt Fleming <matt@codeblueprint.co.uk> - 2015-09-05 21:10 +0200
  Re: [PATCH 2/3] perf tests: Add arch tests Jiri Olsa <jolsa@redhat.com> - 2015-09-07 14:30 +0200
    Re: [PATCH 2/3] perf tests: Add arch tests Matt Fleming <matt@codeblueprint.co.uk> - 2015-09-12 13:10 +0200
  Re: [PATCH 2/3] perf tests: Add arch tests Jiri Olsa <jolsa@redhat.com> - 2015-09-07 14:30 +0200
    Re: [PATCH 2/3] perf tests: Add arch tests Matt Fleming <matt@codeblueprint.co.uk> - 2015-09-12 13:10 +0200
  Re: [PATCH 2/3] perf tests: Add arch tests Jiri Olsa <jolsa@redhat.com> - 2015-09-07 14:40 +0200
    Re: [PATCH 2/3] perf tests: Add arch tests Matt Fleming <matt@codeblueprint.co.uk> - 2015-09-12 13:10 +0200

csiph-web