| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A process name is changed when execve(2), so a new rule based on
process name should be applied when execve(2) happens.
Then this patch adds an EXEC event to the event handler.
TODO:
=====
* The cgroup directory, which is specified by `cgexec` command, is
ignored because this patch adds an EXEC event to the event handler.
This problem should be fixed.
Thanks
Ken'ichi Ohmichi
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds the key "process name" to find a matching rule.
By this patch, cgroup_change_cgroup_uid_gid_flags() gets a process
name by the parameter "pid" internally and uses it to find a matching
rule.
Thanks
Ken'ichi Ohmichi
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds the parser of process name in /etc/cgrules.conf.
A new rule based on process name is as the following, and the process
name is stored into the member "procname" in struct cgroup_rule.
<user>:<process name> <controllers> <destination>
Thanks
Ken'ichi Ohmichi
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are some similar functions for getting process's data (uid,
gid) from /proc/<pid>/status file, so this patch integrates these
functions into one cgroup_get_procdata_from_status().
In addition, cgroup_get_procdata_from_status() can get also a
process name from /proc/<pid>/status file.
Thanks
Ken'ichi Ohmichi
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
|
|
|
|
|
|
|
|
|
|
|
| |
To add the member "procname" to struct cgroup_rule by later patch, this
patch renames the member "name" to "username" for the clarification.
Thanks
Ken'ichi Ohmichi
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The loop in cgroup_parse_rules() is a little long now, and it is not
easy to read the loop.
Then, This patch shortens the loop for the readability.
Thanks
Ken'ichi Ohmichi
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
|
|
|
|
|
|
|
|
|
|
|
| |
By using sizeof() in memset(), we will not need to care of the buffer
size.
Thanks
Ken'ichi Ohmichi
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fix the problem - can be applied now :)
configure.in file wrongly handles YACC and LEX variables so ./configure
exit succesfully, but make fails.
The problems are:
* it enables configuration even if no yacc is installed (it is necessary
for make) - YACC is set to byacc in this case
* the configure.in enables configuration if no lex is installed (it is
again necessary for succesfull make) - in this case YAC is set to ":" i
Signed-off-by: Ivana Varekova <varekova@redhat.com>
Acked-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Hi,
Changelog of v2:
- Add the description of the problematic call sequence.
- There is not any change in the code.
[PATCH-v2] Fix the deadlock of rl_lock.
For avoiding the deadlock, protect cdgroup_change_cgroup_uid_gid_flags()
by blocking SIGUSR2 signal.
The problematic call sequence is the following:
----------------------------------------------------------------------
* CGRULESENGD DAEMON *
<< cgre_flash_rules() is the signal handler for SIGUSR2 signal >>
cgre_create_netlink_socket_process_msg()
<< Receive a UID/GID event packet >>
cgre_handle_msg()
cgre_process_event()
cgroup_change_cgroup_uid_gid_flags()
cgroup_find_matching_rule_uid_gid()
pthread_rwlock_wrlock(&rl_lock); << Get the lock of rl_lock >>
<< Receive a SIGUSR2 signal, and switch to cgre_flash_rules() >>
cgre_flash_rules()
cgroup_reload_cached_rules()
cgroup_parse_rules()
pthread_rwlock_wrlock(&rl_lock); << deadlock ! >>
----------------------------------------------------------------------
A cgrulesengd daemon needs a lock of rl_lock for referring configuration
buffer. On the other way, the daemon reloads configuration file when
receiving SIGUSR2 signal, and it needs the same lock in cgroup_parse_rules().
So cgroup_change_cgroup_uid_gid_flags() should be protected from SIGUSR2
signal for avoiding the deadlock.
Thanks
Ken'ichi Ohmichi
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Hi,
I found the deadlock problem that a cgrulesengd daemon stalls if
service "cgred" is reloaded while many UID events happen.
The following is the gdb output by attaching the stalling daemon:
(gdb) bt
#0 0x0000003b298dd918 in __lll_mutex_lock_wait () from /lib64/libc.so.6
#1 0x0000003b298ce847 in _L_lock_646 () from /lib64/libc.so.6
#2 0x0000003b298ce2da in __vsyslog_chk () from /lib64/libc.so.6
#3 0x0000000000401533 in flog (level=5, format=0x402778 "Reloading rules configuration.") at cgrule sengd.c:130
#4 0x00000000004015d1 in cgre_flash_rules (signum=<value optimized out>) at cgrulesengd.c:644
#5 <signal handler called>
#6 0x0000003b298d27b5 in send () from /lib64/libc.so.6
#7 0x0000003b298ce3a0 in __vsyslog_chk () from /lib64/libc.so.6
#8 0x0000000000401533 in flog (level=4, format=0x402b82 "Failed to open %s") at cgrulesengd.c:130
#9 0x0000000000401cc7 in cgre_process_event (ev=0x7fff8ad11cc4, type=4) at cgrulesengd.c:161
#10 0x0000000000401fd5 in cgre_create_netlink_socket_process_msg () at cgrulesengd.c:486
#11 0x00000000004023ca in main (argc=1, argv=<value optimized out>) at cgrulesengd.c:878
(gdb)
We can see __vsyslog_chk() is called twice, because the daemon
recieved a SIGUSR2 signal in __vsyslog_chk(). In __vsyslog_chk(),
"syslog_lock" is locked by __libc_lock_lock(syslog_lock).
So I think vsyslog() should be protected by blocking the signal,
and this patch fixes the problem by doing it.
Thanks
Ken'ichi Ohmichi
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Hi,
This patch clarifies the infinite loop.
Thanks
Ken'ichi Ohmichi
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Hi,
This patch makes the indent of cgroup_init() shallower for the readability.
Thanks
Ken'ichi Ohmichi
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Acked-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Hi,
This patch adds necessary fclose() calls into egid_of_pid().
Thanks
Ken'ichi Ohmichi
Reported-by: Masayuki Igawa <igawa@mxs.nes.nec.co.jp>
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
libcgrouptest: Fix the cgroup_dbg macro
On compiling with CGROUP_DEBUG enabled, compile was failing.
libcgrouptest01.c: In function ‘main’:
libcgrouptest01.c:57: error: expected ‘)’ before ‘...’ token
libcgrouptest01.c:64: error: expected ‘)’ before ‘...’ token
libcgrouptest01.c:68: error: expected ‘)’ before ‘...’ token
make[2]: *** [libcgrouptest01.o] Error 1
Fix this error.
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Hi,
I installed libcgroup by `make install`, and the service "cgred"
didn't work like the following:
# service cgred start
Starting CGroup Rules Engine Daemon...
/bin/bash: cgrulesengd: command not found
[FAILED]
#
The cause is why the function "daemon" cannot find cgrulesengd
command. This patch fixes the problem by specifying the full path
of cgrulesengd command.
Thanks
Ken'ichi Ohmichi
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Hi,
If failing to open /etc/cgrules.conf in cgroup_parse_rules(), rl_lock
should be unlocked. This patch fixes the code for doing it.
Thanks
Ken'ichi Ohmichi
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
|
|
|
| |
Signed-off-by: Masayuki Igawa <igawa@mxs.nes.nec.co.jp>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
because the function breaks just after getting Uid data:
$ cat /proc/$$/status
[snip]
Uid: 500 500 500 500
Gid: 500 500 500 500
[snip]
$
This patch fixes this problem.
Signed-off-by: Masayuki Igawa <igawa@mxs.nes.nec.co.jp>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
|
|
|
|
|
|
|
| |
Change the binary path for cgred to sbindir
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the hardcoded paths in initscripts to dynamically generated ones. The
real executable path $bindir can be constructed using $prefix and $exec_prefix
variables, therefore it's necessary to define also these two.
The patch includes removal of old initscripts from git - they are generated
from .in file now.
I did not run autoreconf, I think the generated junk is being removed from git
soon.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
For now the result is eg.:
Cgroup generic error, see errno: error message: No such file or directory
this patch remove outdated "see errno: " part.
second version
Signed-off-by: Ivana Varekova <varekova@redhat.com>
Acked-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Fix of cgexec error handling - with this patch cgexec return the right
error message - not only cg internal error value
re-generated
Signed-off-by: Ivana Varekova <varekova@redhat.com>
Acked-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
in long time. And the daemon was killed by an OOM killer. So the
daemon has memory leak. This patch fixes this problem.
The daemon allocates memory at cg_prepare_cgroup(), but it does not
free the memory. This patch adds necessary free() to cgroup_change_
cgroup_path by calling cgroup_free_controllers(). In addition, this
patch adds free()s for handling error and flushes the counters of the
allocations in cgroup_free_controllers().
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Use clock_gettime(2) for getting timestamp since a system boot.
* Change parent_info's memory to dynamic allocation.
This patch is for changing the cgroup of a forked process while parent
changing.
This patch adds the following sequence:
1. Store both the timestamp and the process-id when changing the cgroup.
2. If receiving a PROC_EVENT_FORK packet, check its parent-pid and its
timestamp.
3. If its parent-pid and the stored process-id are same and its timestamp
is older than the stored timestamp, change the cgroup of forked process.
Thanks
Ken'ichi Ohmichi
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
change the cgroup of child occasionally. I tested it by following
configulation file:
/etc/cgrules.conf:
user01 cpuset group01/user01
% memory group01/user01
A cpuset subsystem and a memory subsystem are mounted on different
mount points, and a cgrulesengd daemon manages each subsystem.
I login this environment as a user "user01", and each susbystem's
tasks file is the following:
# cat /mnt/cgroups/cpuset/group01/user01/tasks
31801
31805
31806
#
# cat /mnt/cgroups/memory/group01/user01/tasks
31801
31805
#
# pstree -p 32105
sshd(31801)---sshd(31805)---bash(31806)
#
They should be the same, but they are different. I investigated this
problem, and I found the cause. The reason is that the process(31806)
was forked just after writing the process(31805) to a cpuset subsystem's
tasks file:
<1> The UID/GID CHANGE event of the process 31805 happens.
<2> The daemon writes "31805" to a cpuset subsystem's tasks file.
<3> The process 31806 is forked, and it appears on a cpuset subsystem's
tasks file.
<4> The daemon writes "31805" to a memory subsystem's tasks file.
<5> The process 31806 does not appears on a memory subsystem's tasks file.
For solving this problem, I propose the following sequence.
1. Store both the timestamp and the process-id when the step <4>.
2. If receiving a PROC_EVENT_FORK packet, check its parent-pid and its
timestamp.
3. If its parent-pid and the stored process-id are same and its timestamp
is older than the stored timestamp, change the cgroup of forked process.
Changelog of v2:
* Change only [PATCH 2/2] and there is not any changes in [PATCH 1/2].
This patch adds the method for getting euid/egid from /proc/<pid>/status
file.
For changing the cgroup of a forked process, the method is usefull because
a PROC_EVENT_FORK packet does not inform of its euid and its egid.
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
|
|\
| |
| |
| | |
ssh://balbir_singh@libcg.git.sourceforge.net/gitroot/libcg
|
| |
| |
| |
| |
| |
| |
| | |
These APIs were not available in v0.33. They will be a part of
v0.34 however. Make the change in libcgroup.map reflecting this.
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is the test case for the new API. This test takes one argument, the
group name.
Sample run on my system with this test case returns,
[dhaval@gondor tests]$ ../libtool --mode=execute ./walk_task a
Printing the details of groups a
Pid is 6092
Pid is 11315
Pid is 11318
Pid is 11319
Pid is 11324
Pid is 13234
[dhaval@gondor tests]$
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add a new API to iterate through the tasks file to get
the list of all the tasks in a cgroup.
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
|
|\|
| |
| |
| | |
ssh://balbir_singh@libcg.git.sourceforge.net/gitroot/libcg
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
gcc -DHAVE_CONFIG_H -I. -I.. -I../include -g -O2 -Wall -MT api.lo -MD -MP -MF .deps/api.Tpo -c api.c -fPIC -DPIC -o .libs/api.o
api.c:52:1: warning: "VERSION" redefined
In file included from ./libcgroup-internal.h:21,
from api.c:31:
../config.h:129:1: warning: this is the location of the previous definition
api.c: In function 'cgroup_parse_rules':
api.c:353: warning: implicit declaration of function 'isblank'
api.c: In function 'cgroup_modify_cgroup':
api.c:1073: warning: implicit declaration of function 'asprintf'
This patch fixes the warning arising due to isblank, asprintf and getline.
Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
libcgroup build checks for the availability of cgroup_creat_cgroup
from libcgroup during its build. This causes a build failure if
libcgroup is compiled in a system which already has libcgroup library
installed.
Remove this check from configure.in.
Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Two pthread_rwlock_unlock() calls are necessary if *cgroup is null
and fprintf()/fflush() fails in cgroup_attach_task_pid():
src/api.c:785
785 pthread_rwlock_rdlock(&cg_mount_table_lock);
786 for(i = 0; i < CG_CONTROLLER_MAX &&
787 cg_mount_table[i].name[0]!='\0'; i++) {
[snip]
805 ret = fprintf(tasks, "%d", tid);
806 if (ret < 0) {
<<pthread_rwlock_unlock() call is necessary>>
807 cgroup_dbg("Error writing tid %d to
%s:%s\n",
808 tid, path,
strerror(errno));
809 fclose(tasks);
810 last_errno = errno;
811 return ECGOTHER;
812 }
813
814 ret = fflush(tasks);
815 if (ret) {
<<pthread_rwlock_unlock() call is necessary>>
816 last_errno = errno;
817 cgroup_dbg("Error writing tid %d to
%s:%s\n",
818 tid, path,
strerror(errno));
819 fclose(tasks);
820 return ECGOTHER;
821 }
For the readability, this patch merges almost the same lines into one
function(__cgroup_attach_task_pid()) and adds pthread_rwlock_unlock()
call for the case the function fails.
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Hi,
I tested 'cgred' service and I saw the problem that some processes
are not moved to a right cgroup. This problem did not occur always,
and it did sometimes. I reviewed cgrulesengd.c and found the bug
cgrulesengd stays in an infinite loop if receiving a NLMSG_NOOP
packet.
This patch fixes this problem.
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Hi,
The existing 'cgred' service displays a success message ([ OK ]) when
the service is starting, but it does not display any messages when it
is stopping/reloading. So this patch adds some success/error messages
to 'cgred' service like the following:
# service cgred start
Starting CGroup Rules Engine Daemon...
[ OK ]
#
# service cgred stop
Stopping CGroup Rules Engine Daemon...
[ OK ]
#
# service cgred restart
Stopping CGroup Rules Engine Daemon...
[ OK ]
Starting CGroup Rules Engine Daemon...
[ OK ]
#
# service cgred reload
Reloading rules configuration...
[ OK ]
#
This patch's purpose is almost same as the one of 'cgconfig' service:
http://sourceforge.net/mailarchive/forum.php?thread_name=49D9B778.3000900%40mxs.nes.nec.co.jp&forum_name=libcg-devel
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Hi,
The existing 'cgconfig' service does not display any message even if it
succeeds. So this patch adds some success/error messages to 'cgconfig'
service like the following:
# service cgconfig start
Starting cgconfig service: [ OK ]
#
# service cgconfig stop
Stopping cgconfig service: [ OK ]
#
# service cgconfig restart
Stopping cgconfig service: [ OK ]
Starting cgconfig service: [ OK ]
#
It makes test of 'cgconfig' service a little easy.
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
| |
| |
| |
| |
| |
| | |
config.guess config.sub, depcomp, install-sh and ylwrap removed
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
|
|/
|
|
|
|
| |
updates will be needed and will be done in subsequent cleanups.
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
specific stats. Added Makefile.am updates which I had missed in the
previous post.
New APIs to read controller specific statistics.
This patch introduces 3 new APIs which can be used to read controller
statistics iteratively. (Eg. stats from memory.stat etc)
Reading of stats is initiated by cgroup_read_stats_begin() API, which
returns the first stat of the requested controller in addition to returing
a handle that should be used in subsequent reads.
cgroup_read_stats_next() API can be used to read the remaining stats
one by one. This needs the handle returned by cgroup_read_stats_begin().
cgroup_read_stats_end() API will terminate the stats reading iteration
initiated by cgroup_read_stats_begin().
Changelog:
v2
- Update tests/Makefile.am so that it generates appropriate rules
for tests/read_stats.c in the Makefile. This is in addition to
the manual updates done to the generated file tests/Makefile.in.
v1
- cgroup_read_stats apis now work with relative cgroup path names instead
of absolute path names.
v0
- Initial post.
Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
| |
I reviewed the libcgroup code in the viewpoint of memory-leak and
found a lack of free(). This patch adds a free() call for error
handling.
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
| |
I reviewed the libcgroup code in the viewpoint of memory-leak and
found some lacks of fclose(). This patch adds some fclose() calls
for error handling.
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This time I added duplicate -version-number argument in src/Makefile.am, which
results in following compilation error:
libtool: link: CURRENT `' must be a nonnegative integer
libtool: link: `-version-number' is not valid version information
See the patch below, how it should look like.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
|
|\
| |
| |
| | |
git://fedorapeople.org/~jsafrane/libcg
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Automatically generate libcgroup*.tar.bz2 on 'make dist'. Some restructure
of AC_INIT and AM_INIT was needed to archieve this and correct output
filename.
Namely AC_INIT( [package], ... ) is used as resulting tarball file name now.
Also run automake and autoconf to refresh the generated stuff... Only
configure.in contains manual changes, everything else is autoconf/automake
bloat :(.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
|
| |
| |
| |
| |
| |
| |
| | |
Update the .spec file to reflect automake and autoconf changes. Distribute
the files to the right directories.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Make the shared object version a bit more usable, the notation with double
colons cannot be used on different places (see next patch).
Also run automake && autoconf to refresh the generated stuff.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
cgconfigparser can be executed only by root, so it should be installed to
/sbin directory.
Also run automake to update Makefile.in with this change.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
|
|\| |
|
| |
| |
| |
| |
| |
| | |
Finally run autoreconf -f -i to generate all the stuff that should be generated
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
|
| |
| |
| |
| |
| |
| |
| | |
yacc does not generate y.tab.h, it has different name now.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
|