Re: [PATCH 2/4] tools lib traceevent: Use USECS_PER_SEC instead of hardcoded number

From: Arnaldo Carvalho de Melo
Date: Sat Aug 06 2016 - 16:11:15 EST


Em Fri, Aug 05, 2016 at 03:15:28PM -0400, Steven Rostedt escreveu:
> On Fri, 5 Aug 2016 15:36:55 -0300
> Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> wrote:
>
>
> > [acme@jouet linux]$ cat tools/include/linux/time64.h
> > #ifndef _TOOLS_LINUX_TIME64_H
> > #define _TOOLS_LINUX_TIME64_H
> >
> > #define MSEC_PER_SEC 1000L
> > #define USEC_PER_MSEC 1000L
> > #define NSEC_PER_USEC 1000L
> > #define NSEC_PER_MSEC 1000000L
> > #define USEC_PER_SEC 1000000L
> > #define NSEC_PER_SEC 1000000000L
> > #define FSEC_PER_SEC 1000000000000000LL
> >
> > #endif /* _TOOLS_LINUX_TIME64_H */
> > [acme@jouet linux]$
> >
> > So the header to include is the same as in the kernel, the constants as
> > well. We can go on adding more stuff from include/linux/time64.h as
> > tools use it.
>
> OK, can you modify the scripting-engines/trace-event-*.c to use that
> too. I'm going to move the macros locally into event-parse.c, as I work
> to make that ready to be a separate library.

Ok, and I fix a few more, pushing to perf/core.

> Thanks!
>
> -- Steve