Re: [PATCH 3/3] perf tests: Add is_printable_array test

From: Jiri Olsa
Date: Mon Jul 18 2016 - 08:14:22 EST


On Mon, Jul 18, 2016 at 01:46:02PM +0200, Jiri Pirko wrote:

SNIP

> >diff --git a/tools/perf/tests/is_printable_array.c b/tools/perf/tests/is_printable_array.c
> >new file mode 100644
> >index 000000000000..42e13393e502
> >--- /dev/null
> >+++ b/tools/perf/tests/is_printable_array.c
> >@@ -0,0 +1,36 @@
> >+#include <linux/compiler.h>
> >+#include "tests.h"
> >+#include "debug.h"
> >+#include "util.h"
> >+
> >+int test__is_printable_array(int subtest __maybe_unused)
> >+{
> >+ char buf1[] = { 'k', 'r', 4, 'v', 'a', 0 };
> >+ char buf2[] = { 'k', 'r', 'a', 'v', 4, 0 };
> >+ struct {
> >+ char *buf;
> >+ unsigned int len;
> >+ int ret;
> >+ } t[] = {
> >+ { (char *) "krava", sizeof("krava"), 1 },
> >+ { (char *) "krava", sizeof("krava") - 1, 0 },
>
> "a cow" ? Really? :))

yea, trying to force it as 'perf animal' instead of that pony stuff ;-)

http://www.brendangregg.com/blog/2015-07-08/choosing-a-linux-tracer.html

jirka