| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
|
|
|
|
| |
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
|
|
|
|
| |
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
|
|
|
|
| |
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
|
|
|
|
| |
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
|
|
|
|
| |
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
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 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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
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>
|