[Devel] [PATCH 1/2] kernel, cgroup: Add abilty to enable css_stacks debuging via kernel command line

Kirill Tkhai ktkhai at virtuozzo.com
Thu May 21 16:27:13 MSK 2020


On 18.05.2020 18:14, Andrey Ryabinin wrote:
> Add "css_stacks" parameter to kernel's command line to enable css_stacks
> debug at boot.
> 
> https://jira.sw.ru/browse/PSBM-98148
> Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>

Reviewed-by: Kirill Tkhai <ktkhai at virtuozzo.com>

> ---
>  kernel/cgroup.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/kernel/cgroup.c b/kernel/cgroup.c
> index 17ba1ab9c7b0..bf218e88ac9d 100644
> --- a/kernel/cgroup.c
> +++ b/kernel/cgroup.c
> @@ -4192,6 +4192,7 @@ static int css_stacks_set(void *data, u64 val)
>  DEFINE_SIMPLE_ATTRIBUTE(css_stacks_fops,
>  		css_stacks_get, css_stacks_set, "%llu\n");
>  
> +int setup_css_stacks_cmd;
>  static int __init css_stacks_debugfs(void)
>  {
>  	void *ret;
> @@ -4200,9 +4201,18 @@ static int __init css_stacks_debugfs(void)
>  			&css_stacks_fops);
>  	if (!ret)
>  		pr_warn("Failed to create css_stacks in debugfs");
> +	if (setup_css_stacks_cmd)
> +		static_key_slow_inc(&css_stacks_on);
>  	return 0;
>  }
>  late_initcall(css_stacks_debugfs);
> +
> +static int __init setup_css_stacks(char *str)
> +{
> +	setup_css_stacks_cmd = 1;
> +	return 1;
> +}
> +__setup("css_stacks", setup_css_stacks);
>  #endif
>  
>  static void init_cgroup_css(struct cgroup_subsys_state *css,
> 



More information about the Devel mailing list