lkml.org 
[lkml]   [2015]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/4] perf: jevents: Program to convert JSON file to C style file
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).



\
 
 \ /
  Last update: 2015-05-22 20:01    [W:0.151 / U:0.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site