linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 2/4] tools lib traceevent: Use USECS_PER_SEC instead of hardcoded number
Date: Fri, 5 Aug 2016 15:36:55 -0300	[thread overview]
Message-ID: <20160805183655.GA3789@kernel.org> (raw)
In-Reply-To: <20160805141942.07469948@gandalf.local.home>

Em Fri, Aug 05, 2016 at 02:19:42PM -0400, Steven Rostedt escreveu:
> On Wed, 2 Mar 2016 09:20:04 -0300
> Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> 
> > Em Tue, Feb 09, 2016 at 03:40:15PM -0500, Steven Rostedt escreveu:
> > > From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
> > > 
> > > Instead of using 1000000, define a USECS_PER_SEC macro and use that instead.  
> > 
> > Applying, but the kernel uses USEC_PER_SEC, NSEC_PER_SEC, etc, at some
> > point I'll try and get those same headers in tools/include/ and make all
> > of tools/ use the same convention as the kernel.
> 
> Was this ever applied? Anyway, I'll also go ahead and convert this to
> the non plural versions to match the kernel.

Fell thru the cracks :-\ The other patches in the series were applied
tho.

I'm introducing this and removing the definitions I have in
tools/perf/perf.h for NSEC_PER_SEC and NSEC_PER_USEC:

[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.

- Arnaldo

  reply	other threads:[~2016-08-05 18:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-09 20:40 [PATCH 0/4] tools lib traceevent: Updates from trace-cmd Steven Rostedt
2016-02-09 20:40 ` [PATCH 1/4] tools lib traceevent: Fix time stamp rounding issue Steven Rostedt
2016-03-05  8:19   ` [tip:perf/core] " tip-bot for Chaos.Chen
2016-02-09 20:40 ` [PATCH 2/4] tools lib traceevent: Use USECS_PER_SEC instead of hardcoded number Steven Rostedt
2016-03-02 12:20   ` Arnaldo Carvalho de Melo
2016-08-05 18:19     ` Steven Rostedt
2016-08-05 18:36       ` Arnaldo Carvalho de Melo [this message]
2016-08-05 19:15         ` Steven Rostedt
2016-08-05 23:02           ` Arnaldo Carvalho de Melo
2016-02-09 20:40 ` [PATCH 3/4] tools lib traceevent: Set int_array fields to NULL if freeing from error Steven Rostedt
2016-03-05  8:19   ` [tip:perf/core] " tip-bot for Steven Rostedt (Red Hat)
2016-02-09 20:40 ` [PATCH 4/4] tools lib traceevent: Fix output of %llu for 64 bit values read on 32 bit machines Steven Rostedt
2016-03-05  8:19   ` [tip:perf/core] " tip-bot for Steven Rostedt (Red Hat)
2016-03-01 21:47 ` [PATCH 0/4] tools lib traceevent: Updates from trace-cmd Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160805183655.GA3789@kernel.org \
    --to=acme@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).