zsh-workers
 help / color / mirror / code / Atom feed
* Re: time builtin vs. time(1): difference in memory numbers
       [not found]     ` <101205055913.ZM32440@torch.brasslantern.com>
@ 2010-12-05 18:25       ` Anonymous
  2016-10-16 18:29         ` Baptiste Daroussin
  0 siblings, 1 reply; 6+ messages in thread
From: Anonymous @ 2010-12-05 18:25 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers

Bart Schaefer <schaefer@brasslantern.com> writes:

> On Dec 5,  2:38pm, Anonymous wrote:
> } Subject: Re: time builtin vs. time(1): difference in memory numbers
> }
> } According to getrusage(2) on BSDs ixrss/idrss/isrss are "expressed in
> } units of kilobytes * ticks-of-execution". So, I've made a quick hack
> } 
> }   http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/152820
>
> Looks like it'd be appropriate to wrap that first hunk in
> #ifdef _SC_CLK_TCK
> ??

Does Linux needs to divide them by ticks, too?

>
> I'm curious if FreeBSD has anything like this (from <asm/param.h>
> on RHEL4):
>
> #define HZ sysconf(_SC_CLK_TCK)

No but I'm just an average user. Note, sysconf(_SC_CLK_TCK) returns
CLK_TCK (a constant) defined in <time.h> that may differ from the value
used by getrusage(). [1]

[1] NetBSD does get its value from kern.clockrate sysctl
    and there was a discussion to port it to FreeBSD
      http://docs.freebsd.org/cgi/mid.cgi?20020701142849.U6692-100000


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: time builtin vs. time(1): difference in memory numbers
  2010-12-05 18:25       ` time builtin vs. time(1): difference in memory numbers Anonymous
@ 2016-10-16 18:29         ` Baptiste Daroussin
  2016-10-17  8:47           ` Peter Stephenson
  0 siblings, 1 reply; 6+ messages in thread
From: Baptiste Daroussin @ 2016-10-16 18:29 UTC (permalink / raw)
  To: Zsh workers

2010-12-05 19:25 GMT+01:00 Anonymous <swell.k@gmail.com>:
> Bart Schaefer <schaefer@brasslantern.com> writes:
>
>> On Dec 5,  2:38pm, Anonymous wrote:
>> } Subject: Re: time builtin vs. time(1): difference in memory numbers
>> }
>> } According to getrusage(2) on BSDs ixrss/idrss/isrss are "expressed in
>> } units of kilobytes * ticks-of-execution". So, I've made a quick hack
>> }
>> }   http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/152820
>>
>> Looks like it'd be appropriate to wrap that first hunk in
>> #ifdef _SC_CLK_TCK
>> ??
>
> Does Linux needs to divide them by ticks, too?
>
>>
>> I'm curious if FreeBSD has anything like this (from <asm/param.h>
>> on RHEL4):
>>
>> #define HZ sysconf(_SC_CLK_TCK)
>
> No but I'm just an average user. Note, sysconf(_SC_CLK_TCK) returns
> CLK_TCK (a constant) defined in <time.h> that may differ from the value
> used by getrusage(). [1]
>
> [1] NetBSD does get its value from kern.clockrate sysctl
>     and there was a discussion to port it to FreeBSD
>       http://docs.freebsd.org/cgi/mid.cgi?20020701142849.U6692-100000

I would like to revive this thread as we are having this patch in
FreeBSD for a while now.

https://people.freebsd.org/~bapt/getrusage.diff

What would be the next step to get it upstream (and modified if needed?)

Best regards,
Bapt


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: time builtin vs. time(1): difference in memory numbers
  2016-10-16 18:29         ` Baptiste Daroussin
@ 2016-10-17  8:47           ` Peter Stephenson
  2016-10-17 16:27             ` Baptiste Daroussin
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Stephenson @ 2016-10-17  8:47 UTC (permalink / raw)
  To: Zsh workers

On Sun, 16 Oct 2016 20:29:23 +0200
Baptiste Daroussin <baptiste.daroussin@gmail.com> wrote:
> I would like to revive this thread as we are having this patch in
> FreeBSD for a while now.
> 
> https://people.freebsd.org/~bapt/getrusage.diff
> 
> What would be the next step to get it upstream (and modified if needed?)

The safest way would probably be #ifdef's for Free BSD, unless someone
is going to do a wider investigation into variant system behaviour.

The "long clktck" declaration needs to go with the declarations at the
top.

pws


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: time builtin vs. time(1): difference in memory numbers
  2016-10-17  8:47           ` Peter Stephenson
@ 2016-10-17 16:27             ` Baptiste Daroussin
  2016-10-17 19:49               ` Daniel Shahaf
  0 siblings, 1 reply; 6+ messages in thread
From: Baptiste Daroussin @ 2016-10-17 16:27 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh workers

2016-10-17 10:47 GMT+02:00 Peter Stephenson <p.stephenson@samsung.com>:
> On Sun, 16 Oct 2016 20:29:23 +0200
> Baptiste Daroussin <baptiste.daroussin@gmail.com> wrote:
>> I would like to revive this thread as we are having this patch in
>> FreeBSD for a while now.
>>
>> https://people.freebsd.org/~bapt/getrusage.diff
>>
>> What would be the next step to get it upstream (and modified if needed?)
>
> The safest way would probably be #ifdef's for Free BSD, unless someone
> is going to do a wider investigation into variant system behaviour.
>
> The "long clktck" declaration needs to go with the declarations at the
> top.
>
> pws

I think the ru_maxrss part is valid for linux as well. (unsure)

Best regards,
Bapt


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: time builtin vs. time(1): difference in memory numbers
  2016-10-17 16:27             ` Baptiste Daroussin
@ 2016-10-17 19:49               ` Daniel Shahaf
  2016-10-18 10:56                 ` Peter Stephenson
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Shahaf @ 2016-10-17 19:49 UTC (permalink / raw)
  To: Baptiste Daroussin; +Cc: Peter Stephenson, Zsh workers

Baptiste Daroussin wrote on Mon, Oct 17, 2016 at 18:27:59 +0200:
> 2016-10-17 10:47 GMT+02:00 Peter Stephenson <p.stephenson@samsung.com>:
> > On Sun, 16 Oct 2016 20:29:23 +0200
> > Baptiste Daroussin <baptiste.daroussin@gmail.com> wrote:
> >> I would like to revive this thread as we are having this patch in
> >> FreeBSD for a while now.
> >>
> >> https://people.freebsd.org/~bapt/getrusage.diff
> >>
> >> What would be the next step to get it upstream (and modified if needed?)
> >
> > The safest way would probably be #ifdef's for Free BSD, unless someone
> > is going to do a wider investigation into variant system behaviour.
> >
> > The "long clktck" declaration needs to go with the declarations at the
> > top.
> >
> > pws
> 
> I think the ru_maxrss part is valid for linux as well. (unsure)

On Debian stable, getrusage(2) sas:

       ru_maxrss (since Linux 2.6.32)
              This is the maximum resident set size used (in kilobytes).  For
              RUSAGE_CHILDREN, this is the resident set size of the largest
              child, not the maximum resident set size of the process tree.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: time builtin vs. time(1): difference in memory numbers
  2016-10-17 19:49               ` Daniel Shahaf
@ 2016-10-18 10:56                 ` Peter Stephenson
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Stephenson @ 2016-10-18 10:56 UTC (permalink / raw)
  To: Zsh workers

On Mon, 17 Oct 2016 19:49:18 +0000
Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> > I think the ru_maxrss part is valid for linux as well. (unsure)
> 
> On Debian stable, getrusage(2) sas:
> 
>        ru_maxrss (since Linux 2.6.32)
>               This is the maximum resident set size used (in kilobytes).

Yes, I think the current code dividing by 1024 to get megabytes as
documented is correct.  So it looks like we just need some appropriate
#ifdef's.

pws


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-10-18 10:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <868w06l3cq.fsf@gmail.com>
     [not found] ` <101204102844.ZM5983@torch.brasslantern.com>
     [not found]   ` <86tyisv48o.fsf@gmail.com>
     [not found]     ` <101205055913.ZM32440@torch.brasslantern.com>
2010-12-05 18:25       ` time builtin vs. time(1): difference in memory numbers Anonymous
2016-10-16 18:29         ` Baptiste Daroussin
2016-10-17  8:47           ` Peter Stephenson
2016-10-17 16:27             ` Baptiste Daroussin
2016-10-17 19:49               ` Daniel Shahaf
2016-10-18 10:56                 ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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