All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linuxppc-dev@ozlabs.org
Cc: Bryan Rosenburg <rosnbrg@us.ibm.com>,
	Nathan Lynch <ntl@pobox.com>, Paul Mackerras <paulus@samba.org>,
	Christopher Yeoh <cyeoh@samba.org>
Subject: Re: [PATCH 2/3] powerpc: Instrument Hypervisor Calls: add wrappers
Date: Thu, 15 Jun 2006 13:09:39 +0200	[thread overview]
Message-ID: <200606151309.40360.arnd@arndb.de> (raw)
In-Reply-To: <20060614235217.GA3876@monkey.ibm.com>

On Thursday 15 June 2006 01:52, Mike Kravetz wrote:
> I'm really wondering what would be the best way to make these stats
> available to userspace. =A0As mentioned, putting them into sysfs would
> violate the one value/one file rule. =A0The use of /proc is discouraged.
> debugfs was mentioned, but I have never used it. =A0Noticed that debugfs
> was enabled in the default config (at least for pseries). =A0Looks like
> that would be the best alternative. =A0Agree?

Debugfs sounds good. If you use one file per hcall, it's probably as
easy as

static u64 hcall_stats_get(void *data)
{
	unsigned long index =3D (unsigned long)data;
	return read_hcall_count(index);
}
DEFINE_SIMPLE_ATTRIBUTE(hcall_fops, hcall_stats_get, NULL, "%llu\n");

void hcall_stats_create(void)
{
	unsigned long i;
	struct dentry *dir;

	dir =3D debugfs_create_dir("hcall_stats", NULL);
	for (i=3D0; i <=3D MAX_HCALL_OPCODES; i++) {
		char name[16];
		sprintf(name, "%d", i << 2);
		debugfs_create_file(name, 0444, dir, (void *)i, &hcall_fops);
	}
}

	Arnd <><

  reply	other threads:[~2006-06-15 11:11 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-14  3:47 [PATCH 0/3] powerpc: Instrument Hypervisor Calls Mike Kravetz
2006-06-14  3:50 ` [PATCH 1/3] powerpc: Instrument Hypervisor Calls: merge headers Mike Kravetz
2006-06-14  3:52 ` [PATCH 2/3] powerpc: Instrument Hypervisor Calls: add wrappers Mike Kravetz
2006-06-14  7:23   ` Arnd Bergmann
2006-06-14 14:42   ` Nathan Lynch
2006-06-14 22:33     ` Paul Mackerras
2006-06-14 22:40       ` Nathan Lynch
2006-06-14 23:52         ` Mike Kravetz
2006-06-15 11:09           ` Arnd Bergmann [this message]
2006-06-15 14:58             ` Mike Kravetz
2006-06-15 16:06               ` Arnd Bergmann
2006-06-16 16:11       ` Mike Kravetz
2006-06-14  3:54 ` [PATCH 0/3] powerpc: Instrument Hypervisor Calls: add sysfs files Mike Kravetz
2006-06-14 14:22   ` Nathan Lynch
2006-06-15 11:45     ` Christopher Yeoh
2006-06-14 14:30   ` Dave C Boutcher
2006-06-14 14:39 ` [RFC] New hcall mechanism Was: [PATCH 0/3] powerpc: Instrument Hypervisor Calls Jimi Xenidis
  -- strict thread matches above, loose matches on Subject: below --
2006-06-22 22:56 Mike Kravetz
2006-06-22 22:58 ` [PATCH 2/3] powerpc: Instrument Hypervisor Calls: add wrappers Mike Kravetz
2006-07-14 23:37 [PATCH 0/3] powerpc: Instrument Hypervisor Calls Mike Kravetz
2006-07-14 23:40 ` [PATCH 2/3] powerpc: Instrument Hypervisor Calls: add wrappers Mike Kravetz
2006-07-15  0:15   ` Nathan Lynch
2006-07-15  0:41     ` Mike Kravetz
2006-07-15  8:03       ` Nathan Lynch
2006-07-18 20:47 [PATCH 0/3] powerpc: Instrument Hypervisor Calls Mike Kravetz
2006-07-18 20:49 ` [PATCH 2/3] powerpc: Instrument Hypervisor Calls: add wrappers Mike Kravetz
2006-07-18 22:34   ` Olof Johansson
2006-07-18 23:18     ` Mike Kravetz
2006-07-19  3:33       ` Olof Johansson
2006-07-19  3:50         ` Mike Kravetz

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=200606151309.40360.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=cyeoh@samba.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=ntl@pobox.com \
    --cc=paulus@samba.org \
    --cc=rosnbrg@us.ibm.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 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.