summaryrefslogtreecommitdiff
path: root/src/shared/cgroup-show.h
Commit message (Collapse)AuthorAgeFilesLines
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* Rework cmdline printing to use unicodeZbigniew Jędrzejewski-Szmek2019-05-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | The functions to retrieve and print process cmdlines were based on the assumption that they contain printable ASCII, and everything else should be filtered out. That assumption doesn't hold in today's world, where people are free to use unicode everywhere. This replaces the custom cmdline reading code with a more generic approach using utf8_escape_non_printable_full(). For kernel threads, truncation is done on the parenthesized name, so we'll get "[worker]", "[worker…]", …, "[w…]", "[…", "…" as we reduce the number of available columns. This implementation is most likely slower for very long cmdlines, but I don't think this is very important. The common case is to have short commandlines, and should print those properly. Absurdly long cmdlines are the exception, which needs to be handled correctly and safely, but speed is not too important. Fixes #12532. v2: - use size_t for the number of columns. This change propagates into various other functions that call get_process_cmdline(), increasing the size of the patch, but the changes are rather trivial.
* tree-wide: remove various unused functionsLennart Poettering2018-12-021-1/+0
| | | | All found with "cppcheck --enable=unusedFunction".
* tree-wide: remove Lennart's copyright linesLennart Poettering2018-06-141-4/+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.
* 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.
* 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.
* bus: include sd-{bus,messages}.h the same as other systemd headersZbigniew Jędrzejewski-Szmek2017-04-211-1/+1
| | | | | | This is our own header, we should include use the local-include syntax ("" not <>), to make it clear we are including the one from the build tree. All other includes of files from src/systemd/ use this scheme.
* shared/cgroup-show: extract funtion to query unit cgroup pathZbigniew Jędrzejewski-Szmek2017-02-011-0/+6
| | | | …and use it where possible.
* cgtop: use common function to query cgroup rootZbigniew Jędrzejewski-Szmek2017-02-011-1/+2
| | | | | | | | | | | show_cgroup_get_root_and_warn is renamed to show_cgroup_get_path_and_warn because it now optionally allows querying a non-root path. This removes duplicated code and teaches cgtop to combine -M with a root prefix: $ systemd-cgtop -M myprecious /system.slice ...
* cgls: make function to query cgroup root publicZbigniew Jędrzejewski-Szmek2017-02-011-0/+4
| | | | No functional change.
* shared: drop kernel_thread bool from cgroups show codeLennart Poettering2016-04-221-4/+4
| | | | | Make this an output flag instead, so that our function prototypes can lose one parameter
* tree-wide: remove Emacs lines from all filesDaniel Mack2016-02-101-2/+0
| | | | | This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
* shared: include what we useThomas Hindoe Paaboel Andersen2015-12-061-0/+1
| | | | | The next step of a general cleanup of our includes. This one mostly adds missing includes but there are a few removals as well.
* tree-wide: sort includes in *.hThomas Hindoe Paaboel Andersen2015-11-181-0/+1
| | | | | This is a continuation of the previous include sort patch, which only sorted for .c files.
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-231-1/+0
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* use #pragma once instead of foo*foo define guardsShawn Landden2013-11-181-4/+1
|
* systemctl,loginctl,cgls: do not ellipsize cgroup members when --full is ↵Lukas Nykryn2013-01-161-4/+6
| | | | | | | | | | | | | | | | | | | | specified New file output.h with output flags and modes. --full parameter also for cgls and loginctl. Include 'all' parameter in flags (show_cgroup_by_path, show_cgroup, show_cgroup_and_extra, show_cgroup_and_extra_by_spec). get_process_cmdline with max_length == 0 will not ellipsize output. Replace LINE_MAX with 0 in some calls of get_process_cmdline. [zj: Default to --full when under pager for clgs. Drop '-f' since it wasn't documented and didn't actually work. Reindent a bit. ]
* systemctl: show main and control PID explicitly in cgroup-showLennart Poettering2012-04-161-0/+4
| | | | | | | In some cases the main/control PID of a service can be outside of the services cgroups (for example, if logind readjusts the processes' cgroup). In order to clarify this for the user show the main/control PID in the cgroup tree nonetheless, but mark them specially.
* cgls: don't show empty cgroups by defaultLennart Poettering2012-04-161-2/+2
|
* move more common files to shared/ and add them to shared.laKay Sievers2012-04-121-0/+30