From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757346AbbEVO4i (ORCPT ); Fri, 22 May 2015 10:56:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41256 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756891AbbEVO4f (ORCPT ); Fri, 22 May 2015 10:56:35 -0400 Date: Fri, 22 May 2015 16:56:28 +0200 From: Jiri Olsa To: Sukadev Bhattiprolu 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: <20150522145628.GB16473@krava.redhat.com> References: <1432080130-6678-1-git-send-email-sukadev@linux.vnet.ibm.com> <1432080130-6678-3-git-send-email-sukadev@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1432080130-6678-3-git-send-email-sukadev@linux.vnet.ibm.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 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.. jirka