summaryrefslogtreecommitdiffstats
path: root/src/cgtop (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove path_compare_func() alias for path_compare()Zbigniew Jędrzejewski-Szmek2019-11-151-1/+1
| | | | Non sunt multiplicanda entia sine necessitate.
* tree-wide: drop alloca.h when alloc-util.h is includedYu Watanabe2019-11-031-1/+0
|
* tree-wide: drop string.h when string-util.h or friends are includedYu Watanabe2019-11-031-1/+0
|
* tree-wide: drop missing.hYu Watanabe2019-10-311-0/+1
|
* tree-wide: replace strjoin() with path_join()Yu Watanabe2019-06-201-1/+1
|
* cgtop,test: use consistent capitalization for CGroupZbigniew Jędrzejewski-Szmek2019-05-211-1/+1
|
* Merge pull request #12411 from keszybz/pr/12394Lennart Poettering2019-05-081-0/+1
|\ | | | | run: when emitting the calendarspec warning, use red
| * Enable log colors for most of tools in /usr/binZbigniew Jędrzejewski-Szmek2019-05-081-0/+1
| | | | | | | | | | | | | | | | | | | | When emitting the calendarspec warning we want to see some color. Follow-up for 04220fda5c. Exceptions: - systemctl, because it has a lot hand-crafted coloring - tmpfiles, sysusers, stdio-bridge, etc, because they are also used in services and I'm not sure if this wouldn't mess up something.
* | codespell: fix spelling errorsBen Boeckel2019-04-291-1/+1
|/
* tree-wide: use SYNTHETIC_ERRNO() where appropriateLennart Poettering2019-04-021-4/+3
|
* util: split out sorting related calls to new sort-util.[ch]Lennart Poettering2019-03-131-1/+1
|
* cgtop: Fix processing of controllers other than CPUSzabolcs Fruhwald2019-02-211-65/+65
| | | | | | | | | | | | | | After debugging the issue with gdb, I found that the following change 94ddb08 "cgtop: Still try to get CPU statistics if controller-free" has introduced a bug, which prevents process(..) method processing memory and io controllers when cpu_accounting_is_cheap() is true. The obvious fix is to move this branch to be the last one, keeping the intended behavior of the above change, without having a negative effect on the other controllers. Fixes #11773 [systemd-cgtop no longer shows memory (and io) usage]
* procfs-util: expose functionality to query total memoryZbigniew Jędrzejewski-Szmek2019-01-221-1/+1
| | | | | | | | procfs_memory_get_current is renamed to procfs_memory_get_used, because "current" can mean anything, including total memory, used memory, and free memory, as long as the value is up to date. No functional change.
* cgroup: s/cgroups? ?v?([0-9])/cgroup v\1/gIChris Down2019-01-031-1/+1
| | | | | | | | | | Nitpicky, but we've used a lot of random spacings and names in the past, but we're trying to be completely consistent on "cgroup vN" now. Generated by `fd -0 | xargs -0 -n1 sed -ri --follow-symlinks 's/cgroups? ?v?([0-9])/cgroup v\1/gI'`. I manually ignored places where it's not appropriate to replace (eg. "cgroup2" fstype and in src/shared/linux).
* cgtop: use SWAP_TWO() macroYu Watanabe2018-12-021-5/+1
|
* cgtop: introduce group_hash_ops and use itYu Watanabe2018-12-021-18/+10
|
* coccinelle: make use of SYNTHETIC_ERRNOZbigniew Jędrzejewski-Szmek2018-11-221-16/+15
| | | | | | | | | | | Ideally, coccinelle would strip unnecessary braces too. But I do not see any option in coccinelle for this, so instead, I edited the patch text using search&replace to remove the braces. Unfortunately this is not fully automatic, in particular it didn't deal well with if-else-if-else blocks and ifdefs, so there is an increased likelikehood be some bugs in such spots. I also removed part of the patch that coccinelle generated for udev, where we returns -1 for failure. This should be fixed independently.
* Split out pretty-print.c and move pager.c and main-func.h to shared/Zbigniew Jędrzejewski-Szmek2018-11-201-0/+1
| | | | | This is high-level functionality, and fits better in shared/ (which is for our executables), than in basic/ (which is also for libraries).
* util-lib: move main() definition macros to its own header fileLennart Poettering2018-11-191-0/+1
| | | | | | | | | This way, we can extend the macro a bit with stuff pulled in from other headers without this affecting everything which pulls in macro.h, which is one of our most basic headers. This is just refactoring, no change in behaviour, in prepartion for later changes.
* Merge pull request #10811 from keszybz/define-main-through-macroLennart Poettering2018-11-191-29/+16
|\ | | | | Define main through macro
| * Introduce main definer and use it in cgtopZbigniew Jędrzejewski-Szmek2018-11-171-29/+16
| | | | | | | | This actually fixes one bogus return code in error path.
* | cgtop: Still try to get CPU statistics if controller-freeChris Down2018-11-181-1/+1
|/ | | | | If CPU accounting is cheap, no controller necessarily needs to be enabled here for us to be able to read statistics.
* cgtop: use FOREACH_STRING() for fun and profitLennart Poettering2018-11-161-23/+6
|
* cgtop: use automatic clean-upLennart Poettering2018-11-161-4/+4
|
* cgtop: include error cause in log messageYu Watanabe2018-10-191-5/+7
|
* cgtop: fgets() excorcismLennart Poettering2018-10-181-2/+6
|
* tree-wide: use typesafe_qsort()Yu Watanabe2018-09-191-23/+19
|
* tree-wide: add clickable man page link to all --help textsLennart Poettering2018-08-201-4/+16
| | | | | | | | | | This is a bit like the info link in most of GNU's --help texts, but we don't do info but man pages, and we make them properly clickable on terminal supporting that, because awesome. I think it's generally advisable to link up our (brief) --help texts and our (more comprehensive) man pages a bit, so this should be an easy and straight-forward way to do it.
* tree-wide: remove Lennart's copyright linesLennart Poettering2018-06-141-3/+0
| | | | | | | | | | | These lines are generally out-of-date, incomplete and unnecessary. With SPDX and git repository much more accurate and fine grained information about licensing and authorship is available, hence let's drop the per-file copyright notice. Of course, removing copyright lines of others is problematic, hence this commit only removes my own lines and leaves all others untouched. It might be nicer if sooner or later those could go away too, making git the only and accurate source of authorship information.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-06-141-2/+0
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* path-util: introduce path_simplify()Yu Watanabe2018-06-031-1/+1
| | | | | | | | The function is similar to path_kill_slashes() but also removes initial './', trailing '/.', and '/./' in the path. When the second argument of path_simplify() is false, then it behaves as the same as path_kill_slashes(). Hence, this also replaces path_kill_slashes() with path_simplify().
* path-util: introduce empty_to_root() and use it many placesYu Watanabe2018-05-101-7/+3
|
* tree-wide: use newa() rather than alloca() where we canLennart Poettering2018-04-271-1/+1
|
* util-lib: introduce new empty_or_root() helper (#8746)Lennart Poettering2018-04-181-1/+1
| | | | | | | We check the same condition at various places. Let's add a trivial, common helper for this, and use it everywhere. It's not going to make things much faster or much shorter, but I think a lot more readable
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-061-13/+0
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* Merge pull request #8149 from poettering/fake-root-cgroupLennart Poettering2018-03-011-38/+77
|\ | | | | Properly synthesize CPU+memory accounting data for the root cgroup
| * cgroup-util: rework cg_get_keyed_attribute() a bitLennart Poettering2018-02-091-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Let's make sure we don't clobber the return parameter on failure, to follow our coding style. Also, break the loop early if we have all attributes we need. This also changes the keys parameter to a simple char**, so that we can use STRV_MAKE() for passing the list of attributes to read. This also makes it possible to distuingish the case when the whole attribute file doesn't exist from one key in it missing. In the former case we return -ENOENT, in the latter we now return -ENXIO.
| * cgtop: hook up new /proc based emulation code for root cgroup memory/cpu statsLennart Poettering2018-02-091-16/+27
| | | | | | | | Let's make this work.
| * cgtop: tweak root cgroup detection a bitLennart Poettering2018-02-091-1/+23
| | | | | | | | | | Inside a cgroup-namespaced container we shouldn't assume that "/" is really the root cgroup, because it generally is not.
| * cgtop: command line parsing improvementsLennart Poettering2018-02-091-13/+7
| | | | | | | | | | Always output the string we were unable to parse and use log_error_errno()'s return logic to shorten our code a bit.
| * cgtop: add helper for checking if we are operating on the root cgroupLennart Poettering2018-02-091-1/+5
| |
| * cgtop: add "-1" as shortcut for "--iterations=1"Lennart Poettering2018-02-091-1/+6
| | | | | | | | | | This is most likely the most useful use of --iterations, and such use for numeric parameters has precedents, let's make this work for cgtop too.
| * cgtop: correctly order root cgroup always to the topLennart Poettering2018-02-091-3/+7
| | | | | | | | | | | | | | | | Internally, we encode the root cgroup as empty string. However, path_compare() is allergic to comparing absolute and relative paths. Let's clean this up, by always uses "/" as path for the root cgroup when comparing.
* | tree-wide: use path_hash_ops instead of string_hash_ops whenever we key by a ↵Lennart Poettering2018-02-121-2/+2
|/ | | | | | path Let's make use of our new hash_ops!
* cgtop: make sure we can show a tasks number for the root cgroup tooLennart Poettering2018-01-221-12/+20
| | | | | Let's also use our new API in cgtop so that we can finally show a usable tasks count for the root cgroup too. Yay!
* cgtop: minor modernizationLennart Poettering2018-01-221-1/+2
|
* Add set/hashmap helpers for non-trivial freeing and use where straighforwardZbigniew Jędrzejewski-Szmek2017-11-281-4/+1
| | | | | | A macro is needed because otherwise we couldn't ensure type safety. Some simple tests are included. No functional change intended.
* Add SPDX license identifiers to source files under the LGPLZbigniew Jędrzejewski-Szmek2017-11-191-0/+1
| | | | | This follows what the kernel is doing, c.f. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
* build-sys: drop automake supportZbigniew Jędrzejewski-Szmek2017-07-181-1/+0
| | | | | v2: - also mention m4
* cgtop: check cgroups after parsing optionsZbigniew Jędrzejewski-Szmek2017-04-251-10/+10
| | | | | | | | | | | | We would try to determine controllers even if not necessary: <mock-chroot><mock-chroot> sh-4.4# ./systemd-cgtop --help Failed to determine supported controllers: No medium found <mock-chroot><mock-chroot> sh-4.4# ./systemd-cgtop --version Failed to determine supported controllers: No medium found This broke check-help-systemd-cgtop under mock, but even apart from that, the program should be able to print --version in any circumstances.