lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 03 Apr 2007 19:01:43 -0400
From:	Valdis.Kletnieks@...edu
To:	Maxim Uvarov <muvarov@...mvista.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: Performance Stats: Kernel patch

On Tue, 03 Apr 2007 16:54:43 +0400, Maxim Uvarov said:

> What do you think about it? Patch is bellow.

Was this patch actually compile and run tested?

> Index: linux-2.6.18/fs/proc/array.c
> ===================================================================
> --- linux-2.6.18.orig/fs/proc/array.c
> +++ linux-2.6.18/fs/proc/array.c
> @@ -295,6 +295,18 @@ static inline char *task_cap(struct task
>                             cap_t(p->cap_effective));
>  }
> 
> +#ifdef THREAD_PERF_STAT

This needs to be CONFIG_THREAD_PERF_STAT everyplace except the Kconfig stuff.

> +static inline char *task_perf(struct task_struct *p, char *buffer)
> +{
> +    return buffer + sprintf(buffer, "Nvcsw:\t%lu\n"
> +                           "Nivcsw:\t%lu\n"
> +                           "Syscalls:\t%d\n",
> +                           cap_t(p->nvcsw),
> +                           cap_t(p->nivcsw),
> +                           cap_t(p->sysc_cnt));
> +}

You might want a #else that defines a null body for this inline, to
avoid a problem a bit later.

> +#endif /* THREAD_PERF_STAT */
> +
>  #define get_blocked_on(t)      (-1)
> 
>  static char *show_blocked_on(struct task_struct *task, char *buffer)
> @@ -327,6 +339,7 @@ int proc_pid_status(struct task_struct *
>         buffer = task_show_regs(task, buffer);
>  #endif
>         buffer = show_blocked_on(task,buffer);
> +       buffer = task_perf(task, buffer);

What will this call if you don't have THREAD_PERF_STAT defined?

Here's where you need the #else clause providing a null body for you....

I don't see how this could possibly have built cleanly, since the CONFIG_
issue above would have prevented you from defining a task_perf() function...



Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ