netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Ben Greear <greearb@candelatech.com>
Cc: NetDev <netdev@vger.kernel.org>
Subject: Re: How to grab a block of binary data w/out using ioctls?
Date: Mon, 23 Oct 2006 21:54:48 -0700	[thread overview]
Message-ID: <20061023215448.f4f6c95a.randy.dunlap@oracle.com> (raw)
In-Reply-To: <453D61E8.8020400@candelatech.com>

On Mon, 23 Oct 2006 17:44:24 -0700 Ben Greear wrote:

> Since IOCTLs are out of favor these days, what would be
> a preferred way to get a block of binary data out of the
> kernel?
> 
> I just want to grab a stats structure (well-aligned 32 and 64-bit counters
> and fixed-length strings) for a pktgen interface.
> 
> Can you do this with seq-files somehow?

seq-files just use printk() for text output.  Not well-suited
to binary output.

Similarly, sysfs is desirable in some circumstances, but
not for blocks of binary data.

ioctls or netlink or debugfs or relay output (see how blktrace
uses relay output) are your choices (I may have missed some. :)
ioctls can be OK for some purposes.  If you want to avoid them,
try debugfs or relay.  (I haven't looked at debugfs very much;
it may be more text-oriented also...)

---
~Randy

  reply	other threads:[~2006-10-24  4:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-24  0:44 How to grab a block of binary data w/out using ioctls? Ben Greear
2006-10-24  4:54 ` Randy Dunlap [this message]
2006-10-24  5:00   ` Jeff Garzik
2006-10-24  5:04     ` Randy.Dunlap
2006-10-25  2:25     ` Ben Greear
2006-10-25  2:47       ` Jeff Garzik
2006-10-25  4:35         ` Randy Dunlap
2006-10-25  4:46           ` Jeff Garzik
2006-10-25  4:52             ` Randy.Dunlap
2006-10-25  5:01               ` Jeff Garzik
2006-10-25  5:07                 ` Randy.Dunlap
2006-10-25 16:30             ` Ben Greear
2006-10-25 12:51 ` Hagen Paul Pfeifer

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=20061023215448.f4f6c95a.randy.dunlap@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=greearb@candelatech.com \
    --cc=netdev@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).