All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: eranian@googlemail.com
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	x86@kernel.org, andi@firstfloor.org, eranian@gmail.com,
	sfr@canb.auug.org.au
Subject: Re: [patch 20/24] perfmon: system calls interface
Date: Wed, 26 Nov 2008 15:08:35 +0100	[thread overview]
Message-ID: <20081126140835.GE6562@elte.hu> (raw)
In-Reply-To: <492d0c0b.170e660a.15ba.ffffdabf@mx.google.com>


* eranian@googlemail.com <eranian@googlemail.com> wrote:

> +/*
> + * unlike the other perfmon system calls, this one returns a file descriptor
> + * or a value < 0 in case of error, very much like open() or socket()
> + */
> +asmlinkage long sys_pfm_create(int flags, struct pfarg_sinfo __user *ureq)
> +{
> +	struct pfm_context *new_ctx;
> +	struct pfarg_sinfo sif;
> +	int ret;
> +
> +	PFM_DBG("flags=0x%x sif=%p", flags, ureq);
> +
> +	if (perfmon_disabled)
> +		return -ENOSYS;

uhm. So we have a dynamic 'we dont support perfmon' flag. Which is 
global and defined as:

  +int perfmon_disabled;  /* >0 if perfmon is disabled */

(sidenote: that should be __read_mostly)

then we go:

> +	if (flags) {
> +		PFM_DBG("no flags accepted yet");
> +		return -EINVAL;
> +	}

that should be if (unlikely())

then:

> +	ret = __pfm_create_context(flags, &sif, &new_ctx);

where we get:

+int __pfm_create_context(__u32 ctx_flags,
+                        struct pfarg_sinfo *sif,
+                        struct pfm_context **new_ctx)
+{
+       struct pfm_context *ctx;
+       struct file *filp = NULL;
+       int fd = 0, ret = -EINVAL;
+
+       if (!pfm_pmu_conf)
+               return -ENOSYS;
+

_ANOTHER_ global dynamic flag to tell us that ... in essence 'we dont 
support perfmon'. Which flag is again:

+struct pfm_pmu_config  *pfm_pmu_conf;

... which should be __read_mostly at minimum.

+EXPORT_SYMBOL(pfm_pmu_conf);

and _MUST_ be exported as EXPORT_SYMBOL_GPL. If exported at all. Why 
are any symbols exported here? perfmom does core kernel system calls 
and is non-modular:

+config PERFMON
+       bool "Perfmon2 performance monitoring interface"

it needs _zero_ exports.

	Ingo

  parent reply	other threads:[~2008-11-26 14:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-26  8:42 [patch 20/24] perfmon: system calls interface eranian
2008-11-26 12:02 ` Andi Kleen
2008-11-26 13:43 ` Ingo Molnar
2008-11-26 14:00 ` Ingo Molnar
2008-11-26 16:59   ` Oleg Nesterov
2008-11-27 12:25     ` stephane eranian
2008-11-27 12:41       ` Andi Kleen
2008-11-27 14:22   ` stephane eranian
2008-11-27 14:42     ` Ingo Molnar
2008-11-27 15:16       ` stephane eranian
2008-12-01  0:49     ` Paul Mackerras
2008-12-01  6:05       ` stephane eranian
2008-12-03  2:02   ` Roland McGrath
2008-12-04  1:05   ` Roland McGrath
2008-11-26 14:02 ` Ingo Molnar
2008-11-26 14:08 ` Ingo Molnar [this message]
2008-11-27 14:28   ` stephane eranian
2008-11-26 14:11 ` Ingo Molnar
2008-11-26 14:13 ` Ingo Molnar
2008-11-27 14:01 ` Thomas Gleixner
2008-11-27 14:07   ` stephane eranian
2008-12-01  6:10   ` stephane eranian
  -- strict thread matches above, loose matches on Subject: below --
2008-11-25 21:36 eranian

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=20081126140835.GE6562@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=eranian@gmail.com \
    --cc=eranian@googlemail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=x86@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.