Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1313417
| From | Thomas Gleixner <tglx@linutronix.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC V2 1/2] irq: Add a framework to measure interrupt timings |
| Date | 2016-01-20 19:00 +0100 |
| Message-ID | <qT5d0-1vr-3@gated-at.bofh.it> (permalink) |
| References | <qT3bb-7a-5@gated-at.bofh.it> <qT3ux-vq-3@gated-at.bofh.it> <qT3uz-vq-41@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, 20 Jan 2016, Daniel Lezcano wrote:
> +#ifdef CONFIG_IRQ_TIMINGS
> +/**
> + * struct irqt_ops - structure to be used by the subsystem to track
> + * irq timings
> + * @alloc: called when an irqdesc is allocated
> + * @free: called when an irqdesc is free
> + * @setup: called when an irq is setup, this is called under lock
> + * @remove: called when an irq is removed
> + * @handler: called when an interrupt is handled
> + */
> +struct irqtimings_ops {
> + int (*alloc)(unsigned int);
> + void (*free)(unsigned int);
> + int (*setup)(unsigned int, struct irqaction *act);
> + void (*remove)(unsigned int, void *dev_id);
> + irqt_handler_t handler;
> +};
> +
> +/**
> + * This macro *must* be used by the subsystem interested by the irq
> + * timing information.
> + */
> +#define DECLARE_IRQ_TIMINGS(__ops) \
> + const struct irqtimings_ops *__irqtimings = __ops;
> +#endif
> @@ -20,6 +20,49 @@ extern bool noirqdebug;
>
> extern struct irqaction chained_action;
>
> +#ifdef CONFIG_IRQ_TIMINGS
> +
> +extern const struct irqtimings_ops *__irqtimings;
> +
> +static inline int alloc_irqtiming(unsigned int irq)
> +{
> + if (__irqtimings->alloc)
> + return __irqtimings->alloc(irq);
I really have a hard time to understand that indirection. __irqtimings is
statically allocated and compiled in. There can be only one user for this in
the system ever and that user has all callbacks populated.
Why can't you spare all that pointer muck and simply have:
#ifdef CONFIG_IRQ_TIMINGS
int irqtiming_alloc(usigned int irq);
....
#else
static int irqtiming_alloc(usigned int irq) { return 0; }
...
#endif
and implement those functions in your idle thingy?
Thanks,
tglx
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [RFC PATCH 2/2] sched: idle: IRQ based next prediction for idle period Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-01-18 14:30 +0100
Re: [RFC PATCH 2/2] sched: idle: IRQ based next prediction for idle period Thomas Gleixner <tglx@linutronix.de> - 2016-01-20 16:50 +0100
[RFC V2 2/2] sched: idle: IRQ based next prediction for idle period Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-01-20 17:10 +0100
Re: [RFC V2 2/2] sched: idle: IRQ based next prediction for idle period Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-01-20 18:50 +0100
Re: [RFC V2 2/2] sched: idle: IRQ based next prediction for idle period Peter Zijlstra <peterz@infradead.org> - 2016-01-20 19:50 +0100
Re: [RFC V2 2/2] sched: idle: IRQ based next prediction for idle period Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-01-21 11:10 +0100
Re: [RFC V2 2/2] sched: idle: IRQ based next prediction for idle period Peter Zijlstra <peterz@infradead.org> - 2016-01-20 20:10 +0100
Re: [RFC V2 2/2] sched: idle: IRQ based next prediction for idle period Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-01-20 20:20 +0100
Re: [RFC V2 2/2] sched: idle: IRQ based next prediction for idle period Peter Zijlstra <peterz@infradead.org> - 2016-01-20 20:40 +0100
Re: [RFC V2 2/2] sched: idle: IRQ based next prediction for idle period Peter Zijlstra <peterz@infradead.org> - 2016-01-20 20:40 +0100
Re: [RFC V2 2/2] sched: idle: IRQ based next prediction for idle period Peter Zijlstra <peterz@infradead.org> - 2016-01-20 20:50 +0100
Re: [RFC V2 2/2] sched: idle: IRQ based next prediction for idle period Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-01-20 21:00 +0100
Re: [RFC V2 2/2] sched: idle: IRQ based next prediction for idle period Peter Zijlstra <peterz@infradead.org> - 2016-01-20 21:30 +0100
Re: [RFC V2 2/2] sched: idle: IRQ based next prediction for idle period Thomas Gleixner <tglx@linutronix.de> - 2016-01-20 21:00 +0100
Re: [RFC V2 2/2] sched: idle: IRQ based next prediction for idle period Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-01-21 15:00 +0100
Re: [RFC V2 2/2] sched: idle: IRQ based next prediction for idle period Thomas Gleixner <tglx@linutronix.de> - 2016-01-21 15:20 +0100
[RFC V2 0/2] IRQ based next prediction Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-01-20 17:10 +0100
[RFC V2 2/2] sched: idle: IRQ based next prediction for idle period Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-01-20 17:10 +0100
Re: [RFC V2 2/2] sched: idle: IRQ based next prediction for idle period Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-01-20 21:20 +0100
Re: [RFC V2 2/2] sched: idle: IRQ based next prediction for idle period Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-01-21 14:10 +0100
[RFC V2 0/2] IRQ based next prediction Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-01-20 17:10 +0100
[RFC V2 1/2] irq: Add a framework to measure interrupt timings Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-01-20 17:10 +0100
Re: [RFC V2 1/2] irq: Add a framework to measure interrupt timings Thomas Gleixner <tglx@linutronix.de> - 2016-01-20 19:00 +0100
Re: [RFC V2 1/2] irq: Add a framework to measure interrupt timings Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-01-21 10:30 +0100
Re: [RFC V2 1/2] irq: Add a framework to measure interrupt timings Thomas Gleixner <tglx@linutronix.de> - 2016-01-21 11:30 +0100
Re: [RFC V2 1/2] irq: Add a framework to measure interrupt timings Peter Zijlstra <peterz@infradead.org> - 2016-01-20 20:10 +0100
Re: [RFC V2 1/2] irq: Add a framework to measure interrupt timings Thomas Gleixner <tglx@linutronix.de> - 2016-01-20 21:00 +0100
Re: [RFC V2 1/2] irq: Add a framework to measure interrupt timings Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-01-20 21:10 +0100
Re: [RFC V2 1/2] irq: Add a framework to measure interrupt timings Peter Zijlstra <peterz@infradead.org> - 2016-01-20 21:30 +0100
Re: [RFC V2 1/2] irq: Add a framework to measure interrupt timings Thomas Gleixner <tglx@linutronix.de> - 2016-01-20 21:30 +0100
Re: [RFC V2 1/2] irq: Add a framework to measure interrupt timings Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-01-21 11:00 +0100
Re: [RFC V2 1/2] irq: Add a framework to measure interrupt timings Peter Zijlstra <peterz@infradead.org> - 2016-01-21 11:10 +0100
Re: [RFC V2 1/2] irq: Add a framework to measure interrupt timings Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-01-21 13:40 +0100
Re: [RFC V2 1/2] irq: Add a framework to measure interrupt timings Thomas Gleixner <tglx@linutronix.de> - 2016-01-21 21:30 +0100
Re: [RFC V2 1/2] irq: Add a framework to measure interrupt timings Thomas Gleixner <tglx@linutronix.de> - 2016-01-21 15:00 +0100
Re: [RFC V2 1/2] irq: Add a framework to measure interrupt timings Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-01-21 15:20 +0100
Re: [RFC V2 1/2] irq: Add a framework to measure interrupt timings Thomas Gleixner <tglx@linutronix.de> - 2016-01-21 20:00 +0100
Re: [RFC V2 1/2] irq: Add a framework to measure interrupt timings Peter Zijlstra <peterz@infradead.org> - 2016-01-22 11:20 +0100
Re: [RFC V2 1/2] irq: Add a framework to measure interrupt timings Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-01-21 10:30 +0100
Re: [RFC V2 1/2] irq: Add a framework to measure interrupt timings Peter Zijlstra <peterz@infradead.org> - 2016-01-20 20:30 +0100
Re: [RFC V2 1/2] irq: Add a framework to measure interrupt timings Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-01-21 11:00 +0100
[RFC V2 1/2] irq: Add a framework to measure interrupt timings Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-01-20 17:10 +0100
csiph-web