From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946433AbbEVR0Q (ORCPT ); Fri, 22 May 2015 13:26:16 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:36685 "EHLO e39.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946348AbbEVR0N (ORCPT ); Fri, 22 May 2015 13:26:13 -0400 Date: Fri, 22 May 2015 10:25:40 -0700 From: Sukadev Bhattiprolu To: Jiri Olsa Cc: mingo@redhat.com, ak@linux.intel.com, Michael Ellerman , Arnaldo Carvalho de Melo , Paul Mackerras , namhyung@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] perf: jevents: Program to convert JSON file to C style file Message-ID: <20150522172540.GA23163@us.ibm.com> References: <1432080130-6678-1-git-send-email-sukadev@linux.vnet.ibm.com> <1432080130-6678-3-git-send-email-sukadev@linux.vnet.ibm.com> <20150522145628.GB16473@krava.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150522145628.GB16473@krava.redhat.com> X-Operating-System: Linux 2.0.32 on an i486 User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15052217-0033-0000-0000-000004988B02 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jiri Olsa [jolsa@redhat.com] wrote: | On Tue, May 19, 2015 at 05:02:08PM -0700, Sukadev Bhattiprolu wrote: | | SNIP | | > +int main(int argc, char *argv[]) | > +{ | > + int rc; | > + int flags; | | SNIP | | > + | > + rc = uname(&uts); | > + if (rc < 0) { | > + printf("%s: uname() failed: %s\n", argv[0], strerror(errno)); | > + goto empty_map; | > + } | > + | > + /* TODO: Add other flavors of machine type here */ | > + if (!strcmp(uts.machine, "ppc64")) | > + arch = "powerpc"; | > + else if (!strcmp(uts.machine, "i686")) | > + arch = "x86"; | > + else if (!strcmp(uts.machine, "x86_64")) | > + arch = "x86"; | > + else { | > + printf("%s: Unknown architecture %s\n", argv[0], uts.machine); | > + goto empty_map; | > + } | | hum, wouldnt it be easier to pass the arch directly from the Makefile, | we should have it ready in the $(ARCH) variable.. Yes, I will do that and make all three args (arch, start_dir, output_file) mandatory (jevents won't be run from command line often, it doesn't need default args).