From: Ingo Molnar on

* Johannes Berg <johannes(a)sipsolutions.net> wrote:

> On Thu, 2010-07-22 at 19:18 +0800, Lin Ming wrote:
> > mac80211 tracepoint events are exported like below,
> >
> > /sys/class/ieee80211/events/
> > |-- api_beacon_loss
> > | |-- config
> > | |-- type
> > ....
> > ....
> > |-- drv_add_interface
> > | |-- config
> > | |-- type
> > ....
> > ....
> > |-- stop_queue
> > | |-- config
> > | |-- type
> > |-- wake_queue
> > | |-- config
> > | |-- type
> > ---
> > drivers/base/class.c | 12 ++++++++++++
> > 1 files changed, 12 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/base/class.c b/drivers/base/class.c
> > index 8e231d0..57ada53 100644
> > --- a/drivers/base/class.c
> > +++ b/drivers/base/class.c
> > @@ -19,6 +19,7 @@
> > #include <linux/slab.h>
> > #include <linux/genhd.h>
> > #include <linux/mutex.h>
> > +#include <linux/perf_event.h>
> > #include "base.h"
> >
> > #define to_class_attr(_attr) container_of(_attr, struct class_attribute, attr)
> > @@ -160,6 +161,14 @@ static void klist_class_dev_put(struct klist_node *n)
> > put_device(dev);
> > }
> >
> > +extern struct class ieee80211_class;
> > +
> > +static void class_sys_add_tp(struct kobject *class_kobj, struct class *cls)
> > +{
> > + if (cls == &ieee80211_class)
> > + perf_sys_add_tp(class_kobj, "mac80211");
> > +}
> > +
>
> Ick, what a bad hack! [...]

Yeah, putting driver specific code into generic code for a prototype is OK but
not acceptable as an end result.

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/