From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753620AbbC3W12 (ORCPT ); Mon, 30 Mar 2015 18:27:28 -0400 Received: from mail-ob0-f175.google.com ([209.85.214.175]:34811 "EHLO mail-ob0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752290AbbC3W11 (ORCPT ); Mon, 30 Mar 2015 18:27:27 -0400 MIME-Version: 1.0 In-Reply-To: <5519CD1F.1000300@gmail.com> References: <1427753974-13380-1-git-send-email-eranian@google.com> <1427753974-13380-2-git-send-email-eranian@google.com> <5519CD1F.1000300@gmail.com> Date: Mon, 30 Mar 2015 15:27:26 -0700 Message-ID: Subject: Re: [PATCH v6 1/4] perf,record: Add clockid parameter From: Stephane Eranian To: David Ahern Cc: LKML , Arnaldo Carvalho de Melo , Peter Zijlstra , "mingo@elte.hu" , "ak@linux.intel.com" , Jiri Olsa , Namhyung Kim , Rose Belcher , Sukadev Bhattiprolu , Sonny Rao , John Mccutchan , Adrian Hunter , Pawel Moll Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 30, 2015 at 3:24 PM, David Ahern wrote: > On 3/30/15 4:19 PM, Stephane Eranian wrote: >> >> @@ -761,6 +762,12 @@ void perf_evsel__config(struct perf_evsel *evsel, >> struct record_opts *opts) >> attr->disabled = 0; >> attr->enable_on_exec = 0; >> } >> + >> + if (opts->clockid >= 0) { >> + attr->use_clockid = 1; >> + attr->clockid = opts->clockid; >> + } else >> + attr->clockid = -1; >> } > > > The else part needs to be removed (can't set clockid to -1). And then ... > >> diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c >> index fb43215..164441a 100644 >> --- a/tools/perf/util/header.c >> +++ b/tools/perf/util/header.c >> @@ -1098,6 +1098,8 @@ static void print_event_desc(struct perf_header *ph, >> int fd, FILE *fp) >> } >> fprintf(fp, " }"); >> } >> + fprintf(fp, ", clockid = %d", evsel->attr.clockid); >> + > > > this should be prefaced with: > > if (evsel->attr.use_clockid) > > (use_clockid bit says whether the clockid value was set) Ok, will fix in V7 or Arnaldo grabs the patch and merges it.