Re: [PATCH v8 2/3] proc: add AVX-512 usage elapsed time to /proc/pid/status

From: Thomas Gleixner
Date: Mon Feb 11 2019 - 08:26:41 EST


On Fri, 18 Jan 2019, Aubrey Li wrote:

> Subject: proc: add AVX-512 usage elapsed time to /proc/pid/status

Well, no. This should be split into two patches:

#1 proc/status: Add support for architecture specific output

#2 x86/proc/status: Add AVX-512 usage time

> +/*
> + * Report the amount of time elapsed in millisecond since last AVX512
> + * use in the task.
> + */
> +void avx512_state(struct seq_file *m, struct task_struct *task)
> +{
> + unsigned long timestamp = task->thread.fpu.avx512_timestamp;
> + long delta;
> +
> + if (!timestamp)
> + delta = -1;
> + else {

Still lacks curly brackets around the if () clause

> diff --git a/fs/proc/array.c b/fs/proc/array.c
> index 0ceb3b6b37e7..dd88c2219f08 100644
> --- a/fs/proc/array.c
> +++ b/fs/proc/array.c
> @@ -392,6 +392,10 @@ static inline void task_core_dumping(struct seq_file *m, struct mm_struct *mm)
> seq_putc(m, '\n');
> }

> +void __weak arch_task_state(struct seq_file *m, struct task_struct *task)

Still lacks a function prototype in the appropriate header file and please
rename it to something which makes it clear what this is
about. arch_proc_pid_status() or something like that.

Thanks,

tglx