Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752509AbbG2MbX (ORCPT ); Wed, 29 Jul 2015 08:31:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41109 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752016AbbG2MbW (ORCPT ); Wed, 29 Jul 2015 08:31:22 -0400 Date: Wed, 29 Jul 2015 14:31:17 +0200 From: Jiri Olsa To: kan.liang@intel.com Cc: a.p.zijlstra@chello.nl, acme@kernel.org, luto@kernel.org, mingo@redhat.com, eranian@google.com, ak@linux.intel.com, mark.rutland@arm.com, adrian.hunter@intel.com, jolsa@kernel.org, namhyung@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V3 1/5] perf,tools: introduce generic FEAT for CPU attributes Message-ID: <20150729123117.GF9606@krava.brq.redhat.com> References: <1438082975-47730-1-git-send-email-kan.liang@intel.com> <1438082975-47730-2-git-send-email-kan.liang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1438082975-47730-2-git-send-email-kan.liang@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1331 Lines: 40 On Tue, Jul 28, 2015 at 07:29:31AM -0400, kan.liang@intel.com wrote: SNIP > > +static void print_cpu_attributes(struct perf_header *ph, int fd __maybe_unused, FILE *fp) > +{ > + fprintf(fp, "# CPU attributes: max frequency = %lu KHz\n", ph->env.cpu_attr[PERF_HEADER_CPU_MAX_FREQ]); > +} > + > static void print_branch_stack(struct perf_header *ph __maybe_unused, > int fd __maybe_unused, FILE *fp) > { > @@ -1471,6 +1486,25 @@ static int process_cpuid(struct perf_file_section *section __maybe_unused, > return ph->env.cpuid ? 0 : -ENOMEM; > } > > +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; > + u64 nr; > + > + ret = readn(fd, &nr, sizeof(nr)); > + if (ret != sizeof(nr)) > + return -1; you need to ensure backward compatibility, like new perf with this section extended will be able to read old (current) perf.data file.. and the other way round probably too adding a identifier 'tag' for each value might do it 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/