summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add documentation main pagedevel/doxygen3Jan Safranek2010-03-291-0/+18
| | | | | | | | | | | | | | Add very simple main page to include/libcgroup.h. It contains just very basic info and links to the other modules. Feel free to elaborate more on this, it could contain lot more: - how to complie with libcgroup (=pkgconfig)? - how to report errors - links to samples - link to home page - info about threading etc. Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Document the tasks.hJan Safranek2010-03-291-59/+122
| | | | Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Update config.hJan Safranek2010-03-291-2/+27
| | | | Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Document the iteratorsJan Safranek2010-03-291-89/+269
| | | | Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Add doc to include/libcgroup/error.hJan Safranek2010-03-291-13/+54
| | | | Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Add documentation to include/libcgroup/init.hJan Safranek2010-03-291-6/+35
| | | | Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Document include/libcgroup/groups.hJan Safranek2010-03-291-35/+437
| | | | Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Update doxygen config fileJan Safranek2010-03-291-71/+1344
| | | | | | | | | | | | | | | | | | | Update doxygen config file to 1.6.1 + add comments + change following settings: OUTPUT_DIRECTORY = doc/generated ALWAYS_DETAILED_SEC = YES - we want all function in detailed list JAVADOC_AUTOBRIEF = YES - IMHO the least painfull way to extract brief desxcription, see doxygen docs for the other ways. But still painful enough :( OPTIMIZE_OUTPUT_FOR_C = YES - we're C project IDL_PROPERTY_SUPPORT = NO - we're C project WARN_NO_PARAMDOC = YES - document all function parameters please! INPUT = include - generate public docs only GENERATE_LATEX = NO - no LaTeX for now, maybe later *_GRAPH = NO - no call/include graphs in public docs Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* libcgroup: Fix coding style issues in config.cmasterDhaval Giani2010-03-261-8/+9
| | | | | | | | | | | | | Pre: total: 1 errors, 10 warnings, 817 lines checked Post: total: 0 errors, 4 warnings, 818 lines checked Unfixed warnings are because they break text and therefore capabilities to easily grep through. Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
* libcgroup: Fix up coding style in wrapper.cDhaval Giani2010-03-261-3/+5
| | | | | | | | | | Pre: total: 0 errors, 3 warnings, 638 lines checked Post: total: 0 errors, 0 warnings, 640 lines checked Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
* libcgroup: Dont assign values to variables inside if conditionsDhaval Giani2010-03-261-2/+4
| | | | Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
* libcgroup: Fix coding style issues in api.cDhaval Giani2010-03-261-55/+57
| | | | | | | | | | | | Pre this patch total: 16 errors, 40 warnings, 3321 lines checked Post this patch total: 2 errors, 5 warnings, 3323 lines checked The remaining errors will cause a code change, and so go in a separate patch. Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
* don't export functions that should not be exportedLennart Poettering2010-03-269-36/+36
| | | | | | 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>
* cgget: properly use binary & instead of boolean && when checking for flagsLennart Poettering2010-03-261-2/+2
| | | | | | 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>
* config: don't implicitly import cgroup_config_cleanup_namespace_table(), ↵Lennart Poettering2010-03-261-0/+1
| | | | | | | | this is not K&R C anymore... 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>
* api: don't keep one copy of the mount table per .c fileLennart Poettering2010-03-262-2/+5
| | | | | | | | | | The mount table variables need to be declared in the header file and defined in the .c file. If we don't do that every .o file will end up with its own copy of those variables. 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>
* unexport a couple of variables that don't need to be exportedLennart Poettering2010-03-262-2/+2
| | | | | | 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>
* pkg-config: hide .pc file from gitLennart Poettering2010-03-261-0/+1
| | | | | | 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>
* api: bzero is obsolete BSD, use memset insteadLennart Poettering2010-03-261-1/+1
| | | | | | 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>
* config: pass struct as const call-by-ref instead of call-by-value, to ↵Lennart Poettering2010-03-261-5/+5
| | | | | | | | minimize copying 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>
* config: use macros instead of arrays for const stringsLennart Poettering2010-03-261-2/+2
| | | | | | 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>
* make functions without arguments proper C99 functionsLennart Poettering2010-03-263-10/+10
| | | | | | 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>
* add a couple of FIXMEs to broken codeLennart Poettering2010-03-261-0/+9
| | | | | | 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>
* add const where applicable, drop const where unnecessaryLennart Poettering2010-03-267-41/+41
| | | | | | | | | | | | | | | 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>
* git: hide all generated files from gitLennart Poettering2010-03-247-1/+53
| | | | | | | 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>
* include: refuse inclusion of seperate header filesLennart Poettering2010-03-247-2/+28
| | | | | | | | | | | 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>
* build-sys: add bootstrap.shLennart Poettering2010-03-241-0/+19
| | | | | | | | | | | 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>
* build-sys: enable silent build by defaultLennart Poettering2010-03-241-3/+6
| | | | | | | 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: Add pkg-config dataDhaval Giani2010-03-244-1/+22
| | | | | | | | | | 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>
* libcgroup: Version bump to v0.36.rc1Dhaval Giani2010-03-241-2/+2
| | | | | | | 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 typo in wrapper.c (cgroup_get_uid_gid)Balbir Singh2010-03-241-1/+1
| | | | | | | | | 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>
* Split header file IIIJan Safranek2010-03-2112-450/+515
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Move private definitions to private headerJan Safranek2010-03-214-19/+21
| | | | | | | | | 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>
* Anonymize error enumJan Safranek2010-03-211-1/+1
| | | | | | | | 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>
* Use memset to initialize sigaction structJon Bernard2010-03-121-2/+1
| | | | | | | | | | 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>
* rpm spec file misses the sysconfig/cgconfig fileChris2010-03-111-0/+2
| | | | | | | | | 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>
* init script can miss default groupChris2010-03-111-1/+1
| | | | | | | | | | 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 constJan Safranek2010-03-082-3/+3
| | | | | | | 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 headerJan Safranek2010-03-082-5/+4
| | | | | | | 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 headersJan Safranek2010-03-082-9/+8
| | | | | | | | 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>
* libcgroup: Add a gitignore fileDhaval Giani2010-02-171-0/+2
| | | | Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
* fix cgroup_get_value_string problem with *.stat outputIvana Hutarova Varekova2010-02-102-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* This patch adds to cgget option -a:Ivana Hutarova Varekova2010-02-102-15/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 commandIvana Hutarova Varekova2010-02-102-43/+165
| | | | | | | | | | | | | | | | | | | 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 listing controller variablesIvana Hutarova Varekova2010-02-102-2/+62
| | | | | | | | | | | | 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 controllerIvana Hutarova Varekova2010-02-103-0/+42
| | | | | | | | | | | | | | | 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>
* Release procedure proposalJan Safranek2010-02-102-17/+32
| | | | | | | | | | | | 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>
* [PATCH-v2] Add the write error handling to cg_set_control_value().Ken'ichi Ohmichi2010-01-281-2/+9
| | | | | | | | | | | | | | 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>
* Merge branch 'HEAD'; commit 'v0.35.1'Balbir Singh2010-01-190-0/+0
|
* Update the changelog in libcgroup.spec.inBalbir Singh2010-01-191-0/+2
| | | | Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>