public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: linux-usb-devel@lists.sourceforge.net
Cc: Pete Zaitcev <zaitcev@redhat.com>,
	linux-kernel@vger.kernel.org, greg@kroah.com
Subject: Re: [linux-usb-devel] Re: usbmon, usb core, ARM
Date: Sun, 23 Jan 2005 15:34:23 -0800	[thread overview]
Message-ID: <200501231534.23583.david-b@pacbell.net> (raw)
In-Reply-To: <20050122001237.38596a5b@localhost.localdomain>

On Saturday 22 January 2005 12:12 am, Pete Zaitcev wrote:
> On Thu, 20 Jan 2005 22:28:31 -0800, David Brownell <david-b@pacbell.net> wrote:
> 
> > By the way ... on the topic of usbmon rather than changing
> > usbcore, is there a brief writeup of what you want this
> > new version to be doing -- and how?  Like, why put the
> > spy hooks in that location, rather than any of the other
> > choices.  (Many of them would be less surprising to me!)
> 
> The main idea was to make usbmon invisible if it's not actively monitoring.
> But after thinking about your message I see that it was a misguided approach.
> I'm going to add "if (usbmon_is_running(bus)) usb_mon_hook(bus, urb);" into
> hot paths instead, approximately where current suggestion comments are.

OK ...


> I cannot figure out if you understand the nature of the problem with current
> usbmon,

Where "current" == "research project from a couple years ago, which
doesn't even compile any more"?!?  I don't think many people would,
which is why I wanted to see more info ... :)


> so let me restate it. Simply put, neither dev nor hcd are available 
> at the time urb->complete is called,

Completely untrue.  They are at a minimum provided through the URB itself,
and giveback (which is the only place that call is made!) is passed the HCD
as a parameter.  Or aren't you talking about 2.6.11 code?


> and this is what usbmon intercepts. 
> For one thing, dev is down-counted in usb_unlink_urb().

I don't see any refcounting calls in that routine.  It couldn't change
the refcounts, in any case ... the HCD owns the URB until giveback(),
and all unlinking does is accelerate getting to that giveback().


> Adding hooks explicitly has its disadvantages. Although the giveback
> path is much better, in the submit path such hook cannot inform usbmon
> if the submission fails, and an additional hook is needed. Anyhow, you'll
> see it all in the patch, please give me a couple of days.

OK.  Though I'd still like to see the usbcore hooks as a separate patch
(which can be easily reviewed), with docs (and maybe an example) to
help (idiots like) me see how it's supposed to work.  For example,
how does userspace provide a filter to say what URBs it's interested
in, and what level of information to report?  (Like, "only the first N
bytes of data", timestamping, etc.)  That is, how would a USB analogue
of tcpdump be able to say "spy on what happens with that device", or
"spy on all enumeration".

- Dave

 
> Greetings,
> -- Pete
> 

  reply	other threads:[~2005-01-23 23:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-19  5:20 usbmon, usb core, ARM Pete Zaitcev
2005-01-19  6:14 ` David Brownell
2005-01-19 15:42   ` Pete Zaitcev
2005-01-19 15:54     ` Oliver Neukum
2005-01-19 17:08     ` David Brownell
2005-01-20 19:35       ` Pete Zaitcev
2005-01-21  6:28         ` David Brownell
2005-01-22  8:12           ` Pete Zaitcev
2005-01-23 23:34             ` David Brownell [this message]
2005-01-24  1:17               ` Pete Zaitcev
2005-01-24  2:08                 ` David Brownell

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=200501231534.23583.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=zaitcev@redhat.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