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


Groups > linux.kernel > #1216126

Re: [PATCH V7 1/8] perf,tools: introduce generic FEAT for CPU attributes

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH V7 1/8] perf,tools: introduce generic FEAT for CPU attributes
Date Mon, 31 Aug 2015 11:50:02 +0200
Message-ID <q3tSW-3WF-17@gated-at.bofh.it> (permalink)
References <q2vk5-16k-7@gated-at.bofh.it> <q2vk7-16k-37@gated-at.bofh.it>
X-Original-To Kan Liang <kan.liang@intel.com>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.23 (2014-03-12)
X-Scanned-By MIMEDefang 2.68 on 10.5.11.24
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 41
Organization linux.* mail to news gateway
X-Original-Cc acme@kernel.org, jolsa@kernel.org, a.p.zijlstra@chello.nl, luto@kernel.org, mingo@redhat.com, eranian@google.com, ak@linux.intel.com, mark.rutland@arm.com, adrian.hunter@intel.com, namhyung@kernel.org, linux-kernel@vger.kernel.org
X-Original-Date Mon, 31 Aug 2015 11:46:38 +0200
X-Original-Message-ID <20150831094638.GF22039@krava.brq.redhat.com>
X-Original-References <1440755289-30939-1-git-send-email-kan.liang@intel.com> <1440755289-30939-2-git-send-email-kan.liang@intel.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1216126

Show key headers only | View raw


On Fri, Aug 28, 2015 at 05:48:02AM -0400, Kan Liang wrote:

SNIP

>  
> +static int process_cpu_attributes(struct perf_file_section *section __maybe_unused,
> +				  struct perf_header *ph, int fd,
> +				  void *data __maybe_unused)
> +{
> +	ssize_t ret;
> +	u32 i, tag_id;
> +	u64 nr;
> +
> +	for (i = 0; i < PERF_HEADER_CPU_ATTR_MAX; i++) {
> +
> +		ret = readn(fd, &tag_id, sizeof(tag_id));
> +		if (ret != sizeof(tag_id))
> +			return -1;
> +
> +		if (ph->needs_swap)
> +			nr = bswap_32(tag_id);
> +
> +		if (tag_id >= PERF_HEADER_CPU_ATTR_MAX) {
> +			pr_debug("The number of cpu attributes is not expected. "
> +				 "You may need to upgrade the perf tool.\n");
> +			return -1;
> +		}

I wonder we should let it pass to be able to read new data
with older perf.. but IMO the error is specific enough to
find & fix it if it ever happens

Acked-by: Jiri Olsa <jolsa@kernel.org>

thanks,
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 | Find similar | Unroll thread


Thread

[PATCH V7 0/8] Freq/CPU%/CORE_BUSY% support Kan Liang <kan.liang@intel.com> - 2015-08-28 19:10 +0200
  [PATCH V7 4/8] perf,tools: add backpointer for perf_env to evlist Kan Liang <kan.liang@intel.com> - 2015-08-28 19:10 +0200
    Re: [PATCH V7 4/8] perf,tools: add backpointer for perf_env to evlist Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-28 19:50 +0200
    [tip:perf/core] perf evlist:   Add backpointer for perf_env to evlist tip-bot for Kan Liang <tipbot@zytor.com> - 2015-08-31 10:40 +0200
  [PATCH V7 6/8] perf,tools: Dump per-sample freq/CPU%/CORE_BUSY% in report -D Kan Liang <kan.liang@intel.com> - 2015-08-28 19:10 +0200
    Re: [PATCH V7 6/8] perf,tools: Dump per-sample freq/CPU%/CORE_BUSY%  in report -D Jiri Olsa <jolsa@redhat.com> - 2015-08-31 13:20 +0200
      RE: [PATCH V7 6/8] perf,tools: Dump per-sample freq/CPU%/CORE_BUSY%  in report -D "Liang, Kan" <kan.liang@intel.com> - 2015-08-31 21:20 +0200
    Re: [PATCH V7 6/8] perf,tools: Dump per-sample freq/CPU%/CORE_BUSY%  in report -D Jiri Olsa <jolsa@redhat.com> - 2015-08-31 13:20 +0200
      Re: [PATCH V7 6/8] perf,tools: Dump per-sample freq/CPU%/CORE_BUSY%  in report -D Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-31 22:40 +0200
  [PATCH V7 3/8] perf,tools: rename perf_session_env to perf_env Kan Liang <kan.liang@intel.com> - 2015-08-28 19:10 +0200
    Re: [PATCH V7 3/8] perf,tools: rename perf_session_env to perf_env Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-28 19:50 +0200
    [tip:perf/core] perf tools: Rename perf_session_env to perf_env tip-bot for Kan Liang <tipbot@zytor.com> - 2015-08-31 10:40 +0200
  [PATCH V7 5/8] perf evsel: Add a backpointer to the evlist a evsel is in Kan Liang <kan.liang@intel.com> - 2015-08-28 19:10 +0200
    Re: [PATCH V7 5/8] perf evsel: Add a backpointer to the evlist a  evsel is in Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-28 19:50 +0200
  [PATCH V7 8/8] perf,tools: Show freq/CPU%/CORE_BUSY% in perf report --stdio Kan Liang <kan.liang@intel.com> - 2015-08-28 19:10 +0200
  [PATCH V7 1/8] perf,tools: introduce generic FEAT for CPU attributes Kan Liang <kan.liang@intel.com> - 2015-08-28 19:10 +0200
    Re: [PATCH V7 1/8] perf,tools: introduce generic FEAT for CPU  attributes Jiri Olsa <jolsa@redhat.com> - 2015-08-31 11:50 +0200

csiph-web