bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hurd server introspection and tracing


From: Justus Winter
Subject: Re: Hurd server introspection and tracing
Date: Sat, 25 Oct 2014 16:57:18 +0200
User-agent: alot/0.3.5

Quoting Richard Braun (2014-10-25 16:01:35)
> On Thu, Oct 23, 2014 at 05:16:38PM +0200, Justus Winter wrote:
> > this patch series adds introspection and tracing facilities to the
> > Hurd servers using libports.  This isn't ready yet, but I'd like to
> > give everyone a chance to complain early on.  Some notes:
> > 
> > * I use Machs `Inherited Ports' mechanism to install a receive right
> >   at a well-known location to serve introspection requests.  This is
> >   by choice orthogonal to the usual mechanism used in the Hurd, as I
> >   want it to be as universal as possible (e.g. I want to be able to
> >   use it on the proc server).
> 
> I was initially not sure about that, since I prefer such things to be
> explicit, but it's a very pragmatic choice that I approve.
> 
> > * Servers can label port buckets and classes, and install a function
> >   that creates a human-readable description of an object.  This
> >   information is then presented to the user doing portinfo
> >   --query-process, a feature that is hinted to by a #if 0ed option in
> >   portinfo.c.
> 
> Do we agree that, when saying "install a function", you mean providing
> a RPC to answer introspection requests ? In which case this would mean
> no reply if e.g. a deadlock occurs (although your work on reference
> counting should make deadlocks less frequent). Not flaming here, just
> making sure.

No, I was referring to these two new functions:

/* Label BUCKET with LABEL.  */
void ports_label_bucket (struct port_bucket *bucket, const char *label);

/* Label CLASS with LABEL.  Use DEBUG_INFO to format human-readable
   information about a given object belonging to CLASS into an buffer,
   or the default formatting function if DEBUG_INFO is NULL.  */
void ports_label_class (struct port_class *class, const char *label,
                               error_t (*debug_info) (const void *, char *, 
size_t));

This information is made available using the new
`hurd_port_debug_info' RPC:

/* Return a compact, human-readable description of the object related
   with the receive right NAME.

   This description is meant for debugging purposes and should include
   relevant internal state.  If possible, it should include
   information that is meaningful in other contexts (like a file name,
   or the inode number).

   Return EINVAL if NAME does not denote a receive right managed by
   the port-to-object mapper.  */
routine hurd_port_debug_info (
        introspection: mach_port_t;
        name: mach_port_name_t;
        waittime timeout: natural_t;
        RPT
        out debug_info: string_t);

I've extended portinfo to make use of this:

    % utils/portinfo --receive --query-process 5586 77
        77: receive [bucket: diskfs_port_bucket, class: diskfs_protid_class,
                     node{inode: 48194, hard: 1, weak: 1},
                     path: hello/hurd/developers_:)]

Cheers,
Justus



reply via email to

[Prev in Thread] Current Thread [Next in Thread]