| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Signed-off-by: Lennart Poettering <lennart@poettering.net>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
|
|
|
|
|
|
| |
Signed-off-by: Lennart Poettering <lennart@poettering.net>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds the const qualifier to a number of function arguments
(mostly string arguments) so that client libraries can pass their own
const strings to the library without having to cast their const'ness
away.
This also drops a couple of consts where call-by-value is done anyway,
and which hence has no effect and just misleads the users and adds
unnecessary noise to the signal. After all this is C, not C++.
Signed-off-by: Lennart Poettering <lennart@poettering.net>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
|
|
|
|
|
|
|
| |
Signed-off-by: Lennart Poettering <lennart@poettering.net>
Reviewed-By: Jan Safranek <jsafrane@redhat.com>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Later on it might make sense to move around function definitions between
header files. Hence make sure that nobody includes any header file
directly except the main one.
Signed-off-by: Lennart Poettering <lennart@poettering.net>
Reviewed-By: Jan Safranek <jsafrane@redhat.com>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Most projects carry a bootstrap.sh/autogen.sh file that calls the
autotools in the right order.
This bootstrap.sh also enables the default git commit hook which
enforces a strict kernel-like whitespace regime.
Signed-off-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
|
|
|
|
|
|
|
| |
Make the automake output a bit more like the kbuild output if supported.
Signed-off-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
libcgroup was not making an entry into the pkg-config database, which
makes life easier when using multiple libraries. Add the needed data
in order to be registered with the pkg-config database on installation.
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
Reviewed-by: Jan Safranek <jsafrane@redhat.com>
Acked-by: Lennart Poettering <lennnart@poettering.net>
|
|
|
|
|
|
|
| |
We are now making changes to the specfile, which needs a version
bump. Bump up the version to v0.36.rc1.
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Fix the typo in our cgroup_get_uid_gid routine
We seem to have a typo in the function, the fix is quite obvious.
Reported-by: Ciju Rajan K <ciju@linux.vnet.ibm.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Changelog:
- since there are no global macros, base.h is gone
- since there is no base.h, all headers need to include <features.h> to get
__BEGIN_DECLS
- new init.h with cgroup_init() and cgroup_get_subsys_mount_point()
- new error.h with error handling enum and related stuff
- use #ifndef _LIBCGROUP_*_H instead _LIBCG_*_H in header guards
- fix few checkpatch complaints (long lines, whitespaces, ...)
The patch includes Makefile and .spec changes. I tested it compiles,
make dist produces tarball with all headers, so does also the rpm.
'make' should automatically catch all changes in new headers and
recompile dependent (=all) sources when any header changes.
libcgroup.h
- does not declare anything, it just includes all the other files. In
future, it might contain base of doxygen documentation (some
introduction etc.)
libcgroup/error.h
- the big enum with errors + error related functions
libcgroup/init.h
- libcgroup_init() and cgroup_get_subsys_mount_point()
libcgroup/config.h
- configuration reading/unloading
libcgroup/groups.h
- group manipulation stuff (create/modify/delete/free, incl. controllers and
get/set values) + definition of struct cgroup (=must be included by
libcgroup/tasks.h, which needs it)
libcgroup/iterators.h
- various walks, *_begin/next/end
libcgroup/tasks.h
- task classification, incl. rules cache manipulation
In addition, I probably removed some #includes, which are not needed now when
looking for the minimal #include set to build the project. I also hope I did not
miss any function declaration or macro...
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Most of the macro definitions in licgroup.h are internal, let's move them
to private header. Applications should not depend on them. The only one
really needed is CG_VALUE_MAX, which is used in struct cgroup_stat.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
|
|
|
|
|
|
|
|
| |
The enum with ECG* error codes should be anonymous, as pointed out by
Lennart Poettering.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
The sa_restorer field is not present on some architectures, like alpha.
By using memset, the structure is initialized appropriately regardless of
struct contents.
Signed-off-by: Jon Bernard <jbernard@debian.org>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
|
|
|
|
|
|
|
|
|
| |
The /etc/sysconfig/cgconfig file is never installed with the current RPM
spec file. This fixes it for me:
Signed-off-by: Chris Tasma <chris@deksai.com>
Reviewed-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
If there is a directive like *:httpd before * in the cgconfig file, all
processes end up being moved into the wrong group on cgconfig startup, and
the default group is never made. This fixes it for me:
Signed-off-by: Chris Tasma <chris@deksai.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
|
|
|
|
|
|
|
| |
Make the error stings const, just to be safe.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
|
|
|
|
|
|
|
| |
Remove last_errno from public header, that's why we have cgroup_get_last_errno.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
|
|
|
|
|
|
|
|
| |
Remove GNU_SOURCE from public headers, it has unpredictable consequences on
applications using libcgroup.h
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
|
|
|
|
| |
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fix cgroup_get_value_string problem with *.stat output
the problem was in the low limit for value for the output of stat variables - now there are used the functions cgroup_read_stats_{begin/next/end} for this purpose
bogus output:
./src/tools/cgget -r memory.stat /
/:
memory.stat=cache 1024561152
rss 291270656
pgpgin 1209259
pgpgout 888011
inactive_anon 8192
active_anon 2976481
fixed output:
$ ./src/tools/cgget -r memory.stat /
/:
memory.stat=cache 1024610304
rss 291270656
pgpgin 1209271
pgpgout 888011
inactive_anon 8192
active_anon 297648128
inactive_file 619126784
active_file 399073280
unevictable 24576
hierarchical_memory_limit 9223372036854775807
hierarchical_memsw_limit 9223372036854775807
total_cache 1024610304
total_rss 291270656
total_pgpgin 1209271
total_pgpgout 888011
total_inactive_anon 8192
total_active_anon 297648128
total_inactive_file 619126784
total_active_file 399073280
total_unevictable 24576
Signed-off-by: Ivana Hutarova Varekova <varekova@redhat.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
v2:
removed bunch of unnecessary error messages
This patch adds to cgget option -a:
-a print the variables for all controllers which consists given cgroup
EXAMPLE:
$ ./cgget -a /daemons
/daemons:
cpuset.memory_spread_slab=0
cpuset.memory_spread_page=0
cpuset.memory_pressure=0
cpuset.memory_migrate=0
cpuset.sched_relax_domain_level=-1
cpuset.sched_load_balance=1
cpuset.mem_hardwall=0
cpuset.mem_exclusive=0
cpuset.cpu_exclusive=0
cpuset.mems=
cpuset.cpus=
cpuacct.stat=user 0
system 0
cpuacct.usage_percpu=0 0
cpuacct.usage=0
Signed-off-by: Ivana Hutarova Varekova <varekova@redhat.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
adds new option -g to cgget command
* the option has one argument - controller
* cgget -g devices / returns the values of all variables of controller
devices
* the option could be used multiple times
EXAMLES:
$ ./cgget -n -g cpu -r cpuset.mems /
cpu.rt_period_us=1000000
cpu.rt_runtime_us=950000
cpu.shares=1024
cpuset.mems=0
Signed-off-by: Ivana Hutarova Varekova <varekova@redhat.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the test program for new internal functions:
int cgroup_get_value_name_count(struct cgroup_controller *controller)
char *cgroup_get_value_name(struct cgroup_controller *controller, int index)
The program display the variables of input controllers.
Signed-off-by: Ivana Hutarova Varekova <varekova@redhat.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
api for generating the list of variables of given controller:
changelog - v2:
fixed the space on the end of lines
* int cgroup_get_value_name_count(struct cgroup_controller, *controller)
functions return the number of variables in "controller"
* char *cgroup_get_value_name(struct cgroup_controller *controller, int index)
function return the "index" variable of "controller"
Signed-off-by: Ivana Hutarova Varekova <varekova@redhat.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
this is my proposal for release procedure - it's quite simple and covers all
the technical details you need to know regarding autotools.
Changelog:
- re-diff with current master (and not my internal branch :)
- renumber the steps
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Changelog since v1:
o Use fopen/fprintf/fclose instead of open/write/close.
o Add the error handling against fclose.
cg_set_control_value() is the function for setting a value to a file
of cgroup file system. And current function does not handle the error
of writing to a file. So we cannot know whether setting value is
enable or not. This patch add the error handling for knowing it.
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
|
| |
|
|
|
|
| |
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
|
|
|
|
|
|
|
| |
Put initscipts to /etc/rc.d/init.d, rpm's %{_initrddir} points there.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
|
|
|
|
|
|
|
| |
Fix bad filename in Makefile and make 'make dist' working again.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
|
|
|
|
|
|
|
| |
Distribute cgget tool in rpms.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
|
|
|
|
| |
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
|
|
|
|
|
| |
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
| |
An invalide namespace configuration. This configuration is invalid
because while cpu and cpuacct have been mounted at the same point,
they have different namespaces.
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
| |
Change from v2:
1. Correct the changes made in the config file format. namespace and
mount not in the same file.
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Since every API builds its patch via build_path, updating that
function should be enough.
Changes from v1:
1. Append the namespace only if it is defined. This will remove an
additional "/" which would be introduced otherwise.
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch handles the validation of the newer configuration files.
Some of the rules to be followed
1. We cannot have more controllers in the namespcae section than
already mounted.
2. If more than one controller are mounted at the same point, then
they will have the same namespace. In case it is not explicitly
mentioned, the subsystems at the mount point will be set to the
same namespace. This does not mean that controllers mounted at different
points need to have the same namespace.
Changes from v4:
1. Changed a variable name from mount to mount_path
2. Added more comments
Changes from v3:
1. Removed most of the strdups
2. Fixed return values for errors
Changes from v2:
1. mount and namespace keyword cannot come in the same file.
Changes from v1:
1. Fix a bug where if a namespace was not defined, we were not exiting
2. Comment the validate namespace function
3. Make some of the variables more descriptive
4. Make namespace thread specific
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch introduces a new keywork NAMESPACE which allow cgroups
to be created starting from a certain point as mentioned by the
administrator. This is provided via the configuration file.
Newer APIs will use this feature.
Changes from v1:
1. Attempted to fix the indentation
2. Change a variable name
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
|
|
|
|
|
|
|
| |
Since we add new errors after ECGSENTINEL, it makes no
sense to have the assert in place. Remove the assert.
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 'devel/config3' of git://fedorapeople.org/~jsafrane/libcg:
Clean up the init script
Use tools instead of shell scripts
Make cgclear quiert when there is nothing to clear.
Use cgclear on shutdown
Add sample /etc/sysconfig/cgconfig
Don't create sysdefault group whent it's not needed
Move sysdefault handling to separate function
Remove trailing space from lssubsys output
Fix reading of empty parameter values
Fix error text on failed reading of parameter.
cgget tool
|
| |
| |
| |
| |
| |
| | |
Some parts of the init script are not needed with the recent changes.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
libcgroup now provides some tools, which can be used in the init script
instead of bash code.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Acked-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
| |
| |
| |
| |
| |
| |
| | |
Cgclear clears and unmounts all controllers. Therefore I think it's not an
error when there is nothing to clear and unmount.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Use cgclear on service cgconfig stop, it's much faster than manual group
removal.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Acked-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Feel free to rephrase it's content, I could not find any better words to
describe sysdefault group usability.
Changelog:
- set the default to 'yes'
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
IMHO most of users don't need sysdefault group being created during boot -
it's quite slow and at least in Fedora there is no application using it.
So, let users to configure it and allow them to turn the sysdefault off.
Whether the option should be enabled/disabled is distro-specific, we as
libcgroup turn it on.
Changelog:
- create the sysdefault group by default
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
|
| |
| |
| |
| |
| |
| |
| | |
Move sysdefault handling to separate function - it simplifies following
patch.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
|
| |
| |
| |
| |
| |
| |
| | |
Remove trailing space from lssubsys output, it can confuse scripts.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Acked-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When a group parameter has empty value (like uninitialized cpuset.cpus),
libcgroup does not return this parameter value - it returns
ECGROUPVALUENOTEXIST instead.
I think reading whole parameter file instead of just '%s' is the right thing
to do - it helps also with multiline values, like cpuacct.stat.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
|