All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Jiri Olsa <jolsa@redhat.com>, LKML <linux-kernel@vger.kernel.org>,
	David Ahern <dsahern@gmail.com>, Joonsoo Kim <js1304@gmail.com>,
	Minchan Kim <minchan@kernel.org>,
	Pekka Enberg <penberg@kernel.org>,
	linux-mm@kvack.org
Subject: Re: [PATCH 4/6] perf kmem: Print gfp flags in human readable string
Date: Mon, 11 May 2015 11:35:36 -0300	[thread overview]
Message-ID: <20150511143536.GP28183@kernel.org> (raw)
In-Reply-To: <1429592107-1807-5-git-send-email-namhyung@kernel.org>

Em Tue, Apr 21, 2015 at 01:55:05PM +0900, Namhyung Kim escreveu:
> Save libtraceevent output and print it in the header.

<SNIP>

> +static int parse_gfp_flags(struct perf_evsel *evsel, struct perf_sample *sample,
> +			   unsigned int gfp_flags)
> +{
> +	struct pevent_record record = {
> +		.cpu = sample->cpu,
> +		.data = sample->raw_data,
> +		.size = sample->raw_size,
> +	};
> +	struct trace_seq seq;
> +	char *str, *pos;
> +
> +	if (nr_gfps) {
> +		struct gfp_flag key = {
> +			.flags = gfp_flags,
> +		};
> +
> +		if (bsearch(&key, gfps, nr_gfps, sizeof(*gfps), gfpcmp))
> +			return 0;
> +	}
> +
> +	trace_seq_init(&seq);
> +	pevent_event_info(&seq, evsel->tp_format, &record);
> +
> +	str = strtok_r(seq.buffer, " ", &pos);


This introduced a problem I only now noticed, possibly because my
compiler was upgraded:

[acme@zoo linux]$ git bisect good 
0e11115644b39ff9e986eb308b6c44ca75cd475f is the first bad commit
commit 0e11115644b39ff9e986eb308b6c44ca75cd475f
Author: Namhyung Kim <namhyung@kernel.org>
Date:   Tue Apr 21 13:55:05 2015 +0900

    perf kmem: Print gfp flags in human readable string
    
    Save libtraceevent output and print it in the header.

-------------------------------------------------


  GEN      /tmp/build/perf/common-cmds.h
  PERF_VERSION = 4.1.rc2.ga20d87
  CC       /tmp/build/perf/builtin-kmem.o
builtin-kmem.c: In function a??perf_evsel__process_page_alloc_eventa??:
builtin-kmem.c:743:427: error: a??posa?? may be used uninitialized in this
function [-Werror=maybe-uninitialized]
    new->human_readable = strdup(str + 10);
                                                                                                                                                                                                                                                                                                                                                                                                                                           ^
builtin-kmem.c:716:14: note: a??posa?? was declared here
  char *str, *pos;
              ^
cc1: all warnings being treated as errors
/home/git/linux/tools/build/Makefile.build:68: recipe for target
'/tmp/build/perf/builtin-kmem.o' failed
make[2]: *** [/tmp/build/perf/builtin-kmem.o] Error 1
Makefile.perf:330: recipe for target '/tmp/build/perf/builtin-kmem.o'
failed
make[1]: *** [/tmp/build/perf/builtin-kmem.o] Error 2
Makefile:87: recipe for target 'builtin-kmem.o' failed
make: *** [builtin-kmem.o] Error 2
make: Leaving directory '/home/git/linux/tools/perf'

------

Trying to fix it by initializing it to NULL.

- Arnaldo

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Jiri Olsa <jolsa@redhat.com>, LKML <linux-kernel@vger.kernel.org>,
	David Ahern <dsahern@gmail.com>, Joonsoo Kim <js1304@gmail.com>,
	Minchan Kim <minchan@kernel.org>,
	Pekka Enberg <penberg@kernel.org>,
	linux-mm@kvack.org
Subject: Re: [PATCH 4/6] perf kmem: Print gfp flags in human readable string
Date: Mon, 11 May 2015 11:35:36 -0300	[thread overview]
Message-ID: <20150511143536.GP28183@kernel.org> (raw)
In-Reply-To: <1429592107-1807-5-git-send-email-namhyung@kernel.org>

Em Tue, Apr 21, 2015 at 01:55:05PM +0900, Namhyung Kim escreveu:
> Save libtraceevent output and print it in the header.

<SNIP>

> +static int parse_gfp_flags(struct perf_evsel *evsel, struct perf_sample *sample,
> +			   unsigned int gfp_flags)
> +{
> +	struct pevent_record record = {
> +		.cpu = sample->cpu,
> +		.data = sample->raw_data,
> +		.size = sample->raw_size,
> +	};
> +	struct trace_seq seq;
> +	char *str, *pos;
> +
> +	if (nr_gfps) {
> +		struct gfp_flag key = {
> +			.flags = gfp_flags,
> +		};
> +
> +		if (bsearch(&key, gfps, nr_gfps, sizeof(*gfps), gfpcmp))
> +			return 0;
> +	}
> +
> +	trace_seq_init(&seq);
> +	pevent_event_info(&seq, evsel->tp_format, &record);
> +
> +	str = strtok_r(seq.buffer, " ", &pos);


This introduced a problem I only now noticed, possibly because my
compiler was upgraded:

[acme@zoo linux]$ git bisect good 
0e11115644b39ff9e986eb308b6c44ca75cd475f is the first bad commit
commit 0e11115644b39ff9e986eb308b6c44ca75cd475f
Author: Namhyung Kim <namhyung@kernel.org>
Date:   Tue Apr 21 13:55:05 2015 +0900

    perf kmem: Print gfp flags in human readable string
    
    Save libtraceevent output and print it in the header.

-------------------------------------------------


  GEN      /tmp/build/perf/common-cmds.h
  PERF_VERSION = 4.1.rc2.ga20d87
  CC       /tmp/build/perf/builtin-kmem.o
builtin-kmem.c: In function ‘perf_evsel__process_page_alloc_event’:
builtin-kmem.c:743:427: error: ‘pos’ may be used uninitialized in this
function [-Werror=maybe-uninitialized]
    new->human_readable = strdup(str + 10);
                                                                                                                                                                                                                                                                                                                                                                                                                                           ^
builtin-kmem.c:716:14: note: ‘pos’ was declared here
  char *str, *pos;
              ^
cc1: all warnings being treated as errors
/home/git/linux/tools/build/Makefile.build:68: recipe for target
'/tmp/build/perf/builtin-kmem.o' failed
make[2]: *** [/tmp/build/perf/builtin-kmem.o] Error 1
Makefile.perf:330: recipe for target '/tmp/build/perf/builtin-kmem.o'
failed
make[1]: *** [/tmp/build/perf/builtin-kmem.o] Error 2
Makefile:87: recipe for target 'builtin-kmem.o' failed
make: *** [builtin-kmem.o] Error 2
make: Leaving directory '/home/git/linux/tools/perf'

------

Trying to fix it by initializing it to NULL.

- Arnaldo

  parent reply	other threads:[~2015-05-11 14:35 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-21  4:55 [PATCHSET 0/6] perf kmem: Implement page allocation analysis (v8) Namhyung Kim
2015-04-21  4:55 ` Namhyung Kim
2015-04-21  4:55 ` [PATCH 1/6] perf kmem: Implement stat --page --caller Namhyung Kim
2015-04-21  4:55   ` Namhyung Kim
2015-05-04 15:38   ` Arnaldo Carvalho de Melo
2015-05-04 15:38     ` Arnaldo Carvalho de Melo
2015-05-04 16:11     ` Arnaldo Carvalho de Melo
2015-05-04 16:11       ` Arnaldo Carvalho de Melo
2015-05-06  3:14   ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-04-21  4:55 ` [PATCH 2/6] perf kmem: Support sort keys on page analysis Namhyung Kim
2015-04-21  4:55   ` Namhyung Kim
2015-05-06  3:14   ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-04-21  4:55 ` [PATCH 3/6] perf kmem: Add --live option for current allocation stat Namhyung Kim
2015-04-21  4:55   ` Namhyung Kim
2015-05-06  3:15   ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-04-21  4:55 ` [PATCH 4/6] perf kmem: Print gfp flags in human readable string Namhyung Kim
2015-04-21  4:55   ` Namhyung Kim
2015-05-06  3:15   ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-05-11 14:35   ` Arnaldo Carvalho de Melo [this message]
2015-05-11 14:35     ` [PATCH 4/6] " Arnaldo Carvalho de Melo
2015-05-11 14:41     ` Arnaldo Carvalho de Melo
2015-05-11 14:41       ` Arnaldo Carvalho de Melo
2015-05-11 15:26       ` Namhyung Kim
2015-05-11 15:26         ` Namhyung Kim
2015-04-21  4:55 ` [PATCH 5/6] perf kmem: Add kmem.default config option Namhyung Kim
2015-04-21  4:55   ` Namhyung Kim
2015-05-06  3:15   ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-04-21  4:55 ` [PATCH 6/6] perf kmem: Show warning when trying to run stat without record Namhyung Kim
2015-04-21  4:55   ` Namhyung Kim
2015-05-04 16:15   ` Arnaldo Carvalho de Melo
2015-05-04 16:15     ` Arnaldo Carvalho de Melo
2015-05-05  0:58     ` [PATCH v2] " Namhyung Kim
2015-05-05  0:58       ` Namhyung Kim
2015-05-05 14:07       ` Arnaldo Carvalho de Melo
2015-05-05 14:07         ` Arnaldo Carvalho de Melo
2015-05-05 14:16         ` Pekka Enberg
2015-05-05 14:16           ` Pekka Enberg
2015-05-05 14:52           ` [PATCH v3 6/6] " Namhyung Kim
2015-05-05 14:52             ` Namhyung Kim
2015-05-05 15:01             ` Arnaldo Carvalho de Melo
2015-05-05 15:01               ` Arnaldo Carvalho de Melo
2015-05-06  3:19             ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-05-02 14:55 ` [PATCHSET 0/6] perf kmem: Implement page allocation analysis (v8) Namhyung Kim
2015-05-02 14:55   ` Namhyung Kim
  -- strict thread matches above, loose matches on Subject: below --
2015-04-14  2:52 [PATCHSET 0/6] perf kmem: Implement page allocation analysis (v7) Namhyung Kim
2015-04-14  2:52 ` [PATCH 4/6] perf kmem: Print gfp flags in human readable string Namhyung Kim
2015-04-14  2:52   ` Namhyung Kim

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=20150511143536.GP28183@kernel.org \
    --to=acme@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=dsahern@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=js1304@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=penberg@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.