LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* taskstats accounting info
@ 2007-03-14 12:12 Randy.Dunlap
  2007-03-14 12:18 ` Balbir Singh
  0 siblings, 1 reply; 6+ messages in thread
From: Randy.Dunlap @ 2007-03-14 12:12 UTC (permalink / raw)
  To: jlan, balbir; +Cc: linux-kernel

Hi,

Documentation/accounting/delay-accounting.txt says that the
getdelays program has a "-c cmd" argument, but that option
does not seem to exist in Documentation/account/getdelays.c.

Do you have an updated version of getdelays.c?
If not, please correct that documentation.

Is getdelays.c the best available example of a program
using the taskstats netlink interface?

Thanks,
-- 
~Randy

PS:  Please add your email info to MAINTAINERS or CREDITS or
kernel/*.c so that people don't have to search email archives
in order to be able to contact you.

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

* Re: taskstats accounting info
  2007-03-14 12:12 taskstats accounting info Randy.Dunlap
@ 2007-03-14 12:18 ` Balbir Singh
  2007-03-15 19:06   ` Andrew Morton
  0 siblings, 1 reply; 6+ messages in thread
From: Balbir Singh @ 2007-03-14 12:18 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: jlan, linux-kernel

Randy.Dunlap wrote:
> Hi,
> 
> Documentation/accounting/delay-accounting.txt says that the
> getdelays program has a "-c cmd" argument, but that option
> does not seem to exist in Documentation/account/getdelays.c.
> 
> Do you have an updated version of getdelays.c?
> If not, please correct that documentation.
> 

Yes, I did, but then I changed my laptop. I should have it archived
at some place, I'll dig it out or correct the documentation.

> Is getdelays.c the best available example of a program
> using the taskstats netlink interface?
> 

It's the most portable example, since it does not depend on libnl.
It needs some cleaning up. I hope to get to it after the OLS
paper submission deadline.

> Thanks,

Thanks for bringing the issue to my notice,

-- 
	Warm Regards,
	Balbir Singh
	Linux Technology Center
	IBM, ISTL

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

* Re: taskstats accounting info
  2007-03-14 12:18 ` Balbir Singh
@ 2007-03-15 19:06   ` Andrew Morton
  2007-03-15 22:37     ` Balbir Singh
  2007-03-19 15:35     ` Randy Dunlap
  0 siblings, 2 replies; 6+ messages in thread
From: Andrew Morton @ 2007-03-15 19:06 UTC (permalink / raw)
  To: balbir; +Cc: rdunlap, jlan, linux-kernel

> On Wed, 14 Mar 2007 17:48:32 +0530 Balbir Singh <balbir@in.ibm.com> wrote:
> Randy.Dunlap wrote:
> > Hi,
> > 
> > Documentation/accounting/delay-accounting.txt says that the
> > getdelays program has a "-c cmd" argument, but that option
> > does not seem to exist in Documentation/account/getdelays.c.
> > 
> > Do you have an updated version of getdelays.c?
> > If not, please correct that documentation.
> > 
> 
> Yes, I did, but then I changed my laptop. I should have it archived
> at some place, I'll dig it out or correct the documentation.
> 
> > Is getdelays.c the best available example of a program
> > using the taskstats netlink interface?
> > 
> 
> It's the most portable example, since it does not depend on libnl.

err, what is libnl?

If there exists some real userspace infrastructure which utilises
taskstats, can we please get a referece to it into the kernel
Documentation?  Perhaps in the TASKSTATS Kconfig entry, thanks.


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

* Re: taskstats accounting info
  2007-03-15 19:06   ` Andrew Morton
@ 2007-03-15 22:37     ` Balbir Singh
  2007-03-19 15:35     ` Randy Dunlap
  1 sibling, 0 replies; 6+ messages in thread
From: Balbir Singh @ 2007-03-15 22:37 UTC (permalink / raw)
  To: Andrew Morton; +Cc: rdunlap, jlan, linux-kernel

Andrew Morton wrote:
>> On Wed, 14 Mar 2007 17:48:32 +0530 Balbir Singh <balbir@in.ibm.com> wrote:
>> Randy.Dunlap wrote:
>>> Hi,
>>>
>>> Documentation/accounting/delay-accounting.txt says that the
>>> getdelays program has a "-c cmd" argument, but that option
>>> does not seem to exist in Documentation/account/getdelays.c.
>>>
>>> Do you have an updated version of getdelays.c?
>>> If not, please correct that documentation.
>>>
>> Yes, I did, but then I changed my laptop. I should have it archived
>> at some place, I'll dig it out or correct the documentation.
>>
>>> Is getdelays.c the best available example of a program
>>> using the taskstats netlink interface?
>>>
>> It's the most portable example, since it does not depend on libnl.
> 
> err, what is libnl?

libnl is a library abstraction for netlink (libnetlink).

> 
> If there exists some real userspace infrastructure which utilises
> taskstats, can we please get a referece to it into the kernel
> Documentation?  Perhaps in the TASKSTATS Kconfig entry, thanks.
> 

That sounds like a good idea. I'll check for details and get back.

-- 
	Warm Regards,
	Balbir Singh
	Linux Technology Center
	IBM, ISTL

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

* Re: taskstats accounting info
  2007-03-15 19:06   ` Andrew Morton
  2007-03-15 22:37     ` Balbir Singh
@ 2007-03-19 15:35     ` Randy Dunlap
  2007-03-21  3:59       ` Balbir Singh
  1 sibling, 1 reply; 6+ messages in thread
From: Randy Dunlap @ 2007-03-19 15:35 UTC (permalink / raw)
  To: Andrew Morton; +Cc: balbir, rdunlap, jlan, linux-kernel

On Thu, 15 Mar 2007 11:06:55 -0800 Andrew Morton wrote:

> > On Wed, 14 Mar 2007 17:48:32 +0530 Balbir Singh <balbir@in.ibm.com> wrote:
> > Randy.Dunlap wrote:
> > > Hi,
> > > 
> > > Documentation/accounting/delay-accounting.txt says that the
> > > getdelays program has a "-c cmd" argument, but that option
> > > does not seem to exist in Documentation/account/getdelays.c.
> > > 
> > > Do you have an updated version of getdelays.c?
> > > If not, please correct that documentation.
> > > 
> > 
> > Yes, I did, but then I changed my laptop. I should have it archived
> > at some place, I'll dig it out or correct the documentation.
> > 
> > > Is getdelays.c the best available example of a program
> > > using the taskstats netlink interface?
> > > 
> > 
> > It's the most portable example, since it does not depend on libnl.
> 
> err, what is libnl?

lib-netlink (as already answered, but I wrote this last week)

> If there exists some real userspace infrastructure which utilises
> taskstats, can we please get a referece to it into the kernel
> Documentation?  Perhaps in the TASKSTATS Kconfig entry, thanks.


Balbir, I was working with getdelays.c when I initially wrote
these questions.  Here is a small patch for it.  Hopefully you can
use it when you find the updated version of it.

~Randy

From: Randy Dunlap <randy.dunlap@oracle.com>

1.  add usage() function

2.  add unknown character in %c format (was only in %d, not useful):

./getdelays: invalid option -- h
Unknown option '?' (63)

instead of:

./getdelays: invalid option -- h
Unknown option 63

(or just remove that message)

3.  -v does not use an optarg, so remove ':' in getopt string after 'v';

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 getdelays.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

--- old/Documentation/accounting/getdelays.c
+++ new/Documentation/accounting/getdelays.c
@@ -72,6 +72,15 @@ struct msgtemplate {
 
 char cpumask[100+6*MAX_CPUS];
 
+static void usage(void)
+{
+	fprintf(stderr, "getdelays [-dilv] [-w logfile] [-r bufsize] [-m cpumask] [-t tgid] [-p pid]\n");
+	fprintf(stderr, "  -d: print delayacct stats\n");
+	fprintf(stderr, "  -i: print IO accounting\n");
+	fprintf(stderr, "  -l: listen forever\n");
+	fprintf(stderr, "  -v: debug on\n");
+}
+
 /*
  * Create a raw netlink socket and bind
  */
@@ -227,7 +236,7 @@ int main(int argc, char *argv[])
 	struct msgtemplate msg;
 
 	while (1) {
-		c = getopt(argc, argv, "diw:r:m:t:p:v:l");
+		c = getopt(argc, argv, "diw:r:m:t:p:vl");
 		if (c < 0)
 			break;
 
@@ -277,7 +286,8 @@ int main(int argc, char *argv[])
 			loop = 1;
 			break;
 		default:
-			printf("Unknown option %d\n", c);
+			printf("Unknown option '%c' (%d)\n", c, c);
+			usage();
 			exit(-1);
 		}
 	}

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

* Re: taskstats accounting info
  2007-03-19 15:35     ` Randy Dunlap
@ 2007-03-21  3:59       ` Balbir Singh
  0 siblings, 0 replies; 6+ messages in thread
From: Balbir Singh @ 2007-03-21  3:59 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Andrew Morton, rdunlap, jlan, linux-kernel

Randy Dunlap wrote:
> On Thu, 15 Mar 2007 11:06:55 -0800 Andrew Morton wrote:
> 
>>> It's the most portable example, since it does not depend on libnl.
>> err, what is libnl?
> 
> lib-netlink (as already answered, but I wrote this last week)
> 

I was referring to the library at http://people.suug.ch/~tgr/libnl/

>> If there exists some real userspace infrastructure which utilises
>> taskstats, can we please get a referece to it into the kernel
>> Documentation?  Perhaps in the TASKSTATS Kconfig entry, thanks.
> 
> 
> Balbir, I was working with getdelays.c when I initially wrote
> these questions.  Here is a small patch for it.  Hopefully you can
> use it when you find the updated version of it.
> 
> ~Randy
> 
> From: Randy Dunlap <randy.dunlap@oracle.com>
> 
> 1.  add usage() function
> 
> 2.  add unknown character in %c format (was only in %d, not useful):
> 
> ./getdelays: invalid option -- h
> Unknown option '?' (63)
> 
> instead of:
> 
> ./getdelays: invalid option -- h
> Unknown option 63
> 
> (or just remove that message)
> 
> 3.  -v does not use an optarg, so remove ':' in getopt string after 'v';
> 

Thanks, these look good. I'll add them to my local copy.



-- 
	Warm Regards,
	Balbir Singh
	Linux Technology Center
	IBM, ISTL

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

end of thread, other threads:[~2007-03-21  3:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-14 12:12 taskstats accounting info Randy.Dunlap
2007-03-14 12:18 ` Balbir Singh
2007-03-15 19:06   ` Andrew Morton
2007-03-15 22:37     ` Balbir Singh
2007-03-19 15:35     ` Randy Dunlap
2007-03-21  3:59       ` Balbir Singh

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