[kernel-br] [PATCH] task_io_accounting, taskstats

tinhocas em gmail.com tinhocas em gmail.com
Quinta Agosto 19 10:46:57 EDT 2010


Segue anexo o pequeno patch pra net taskstats accounting.

Exemplo de userland:

[root][hm2306][.c0] #  cat ustatsd.log | grep -i comlines1

{ "host" : "hm2306",  "uid" : "11606",  "name" : "comlines1",  "time"
: "2010:05:12:13:44",  "ucpu" : "29864000",  "pucpu" : "49.77",
"scpu" : "5936000",  "pscpu" : "9.89",  "mem" : "1727.23"  }
{ "host" : "hm2306",  "uid" : "11606",  "name" : "comlines1",  "time"
: "2010:05:12:13:45",  "ucpu" : "30180000",  "pucpu" : "50.29",
"scpu" : "5236000",  "pscpu" : "8.73",  "mem" : "1535.17"  }
{ "host" : "hm2306",  "uid" : "11606",  "name" : "comlines1",  "time"
: "2010:05:12:13:46",  "ucpu" : "33064000",  "pucpu" : "55.11",
"scpu" : "5892000",  "pscpu" : "9.82",  "mem" : "1669.16"  }

O PUCPU eh porcentagem de utilizacao (ncpus * 100) e o PSCPU eh
porcentagem de utilizacao de system do mesmo uid. Memoria hoje em dia
eh um high watermark de todos procs que estao ativos e/ou morreram no
timequantum medido.

O userland gera um xmpp em json de mais de 1500 usuários por máquinas
falando o consumo total de cpu, memoria, disco e (com meu patch) rede.
Tem um frontend que gera os graficos de utilizacao de recursos por
usuário.

Abs

Inaddy

[root][macbook][linux-2.6.33.5]# patch -p1 <
/home/inaddy/codes/ustats/us_2.6.33.x.patch
patching file include/linux/task_io_accounting.h
patching file include/linux/task_io_accounting_ops.h
patching file include/linux/taskstats.h
patching file net/socket.c

CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_CONNECTOR=y
CONFIG_PROC_EVENTS=y



---------- Forwarded message ----------
From: Rafael Tinoco <tinhocas at gmail.com>
Date: Thu, Jun 3, 2010 at 10:07 PM
Subject: Re: [PATCH] task_io_accounting, taskstats
To: LKML <linux-kernel at vger.kernel.org>, Balbir <balbir at linux.vnet.ibm.com>

Balbir, sorry Ive made a mistake sending the patch, it was an
incomplete and wrong diff.
And Ive fixed all the "tab" and signed-off-by issues.

[inaddy][macbook][linux-2.6.33.5]$ ./scripts/checkpatch.pl
/home/inaddy/codes/ustats/us_2.6.33.x.patch
total: 0 errors, 0 warnings, 125 lines checked

Tests to confirm patch is working, commands:

# netcat -l -p 8080
# cat /etc/passwd | netcat localhost 8080
# cat /etc/passwd | wc -c
1126

# ./ustatsd (getting the 1126 bytes read and written for the netcat cmds)

proc_event_exit: pid 3704 uid 0 (ucpu: 4000) (scpu: 0) (rdisk: 0)
(wdisk: 0) (rnet: 0) (wnet: 1126) (comm: netcat)
proc_event_exit: pid 3702 uid 0 (ucpu: 4000) (scpu: 0) (rdisk: 0)
(wdisk: 0) (rnet: 1126) (wnet: 0) (comm: netcat)

The attached patch is working. Ill be releasing in this same mail
thread the userland code.

I'll send another email with [PATCH] to the maintainer and to the list.

Thank you.

Rafael Tinoco
-------------- next part --------------
A non-text attachment was scrubbed...
Name: us_2.6.33.x.patch
Type: text/x-patch
Size: 4674 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernel-br/attachments/20100819/a6ee1cb1/attachment.bin 


Mais detalhes sobre a lista de discussão kernel-br