mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Valdis.Kletnieks@vt.edu
To: Maxim Uvarov <muvarov@ru.mvista.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Performance Stats: Kernel patch
Date: Tue, 03 Apr 2007 19:01:43 -0400	[thread overview]
Message-ID: <16797.1175641303@turing-police.cc.vt.edu> (raw)
In-Reply-To: Your message of "Tue, 03 Apr 2007 16:54:43 +0400." <46124E93.2000408@ru.mvista.com>

[-- Attachment #1: Type: text/plain, Size: 1706 bytes --]

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...



[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]

  reply	other threads:[~2007-04-03 23:01 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-03 12:54 Maxim Uvarov
2007-04-03 23:01 ` Valdis.Kletnieks [this message]
2007-04-04 13:15   ` Maxim Uvarov
2007-04-04 13:46     ` Eric Dumazet
2007-04-04 16:52       ` Maxim Uvarov
2007-04-04 18:04         ` Eric Dumazet
2007-04-04 21:54       ` Valdis.Kletnieks
2007-04-04 13:59     ` Jesper Juhl
2007-04-04 21:50     ` Valdis.Kletnieks
2007-04-04 22:03       ` Randy Dunlap
2007-04-06 21:50       ` Bill Davidsen
2007-04-08 16:58     ` Pavel Machek
2007-04-09 14:22 Maxim Uvarov
2007-04-10  8:21 ` Eric Dumazet
2007-04-11 11:59   ` Maxim Uvarov
2007-04-11 12:26     ` Eric Dumazet
2007-04-11 13:15       ` Maxim Uvarov
2007-04-11 14:15     ` Eric Dumazet
2007-04-11 15:33       ` Bill Davidsen
2007-04-11 15:57         ` Maxim Uvarov
2007-04-11 15:53       ` Maxim Uvarov
2007-04-11 19:22         ` Eric Dumazet
2007-04-12 13:46           ` Maxim Uvarov
2007-04-15  9:47 ` Pavel Machek
2007-04-15 10:21   ` William Lee Irwin III
2007-04-15 20:10     ` Pavel Machek
2007-04-16  1:04       ` William Lee Irwin III
2007-04-16  9:24         ` Maxim Uvarov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16797.1175641303@turing-police.cc.vt.edu \
    --to=valdis.kletnieks@vt.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=muvarov@ru.mvista.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®