Re: [PATCH 1/2] Trace code and documentation

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

 



On Fri, 14 Sep 2007 18:08:40 -0700 Andrew Morton wrote:

> > Trace - Provides tracing primitives
> > 
> > ...
> >
> > +config TRACE
> > +	bool "Trace setup and control"
> > +	select RELAY
> > +	select DEBUG_FS
> > +	help
> > +	  This option provides support for the setup, teardown and control
> > +	  of tracing channels from kernel code.  It also provides trace
> > +	  information and control to userspace via a set of debugfs control
> > +	  files.  If unsure, say N.
> > +
> 
> select is evil - you really want to avoid using it.

I checked when I reviewed(?) this patch.  There are a few other
places that select also (IIRC, the blktrace code does), but most of
them use depends on.

> The problem is where you select a symbol whose dependencies aren't met. 
> Kconfig resolves this incompatibility by just not selecting the thing you
> wanted, iirc.  So your CONFIG_SYSFS=n, CONFIG_TRACE=y kernel won't build.
> 
> > +/*
> > + * Based on blktrace code, Copyright (C) 2006 Jens Axboe <[email protected]>
> 
> So can we migrate blktrace to using this?

> > +static ssize_t sub_size_read(struct file *filp, char __user *buffer,
> > +			     size_t count, loff_t *ppos)
> > +{
> > +	struct trace_info *trace = filp->private_data;
> > +	char buf[32];
> > +
> > +	snprintf(buf, sizeof(buf), "%u\n",
> > +		 (unsigned int)trace->rchan->subbuf_size);
> 
> Use %tu to print a size_t, rather than the typecast.

Eh?
Use %zu to print a size_t.  Use %tu to print a ptrdiff_t.


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux