aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/irq/matrix.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2017-09-13 17:29:15 -0400
committerThomas Gleixner <tglx@linutronix.de>2017-09-25 14:38:26 -0400
commitec0f7cd273dc41ab28bba703cac82690ea5f2863 (patch)
tree6343ee6052694a1a939f1b39ff992bbf707c0e66 /kernel/irq/matrix.c
parent2f75d9e1c90511bff6d1ce4de94503cc28fec032 (diff)
genirq/matrix: Add tracepoints
Add tracepoints for the irq bitmap matrix allocator. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Juergen Gross <jgross@suse.com> Tested-by: Yu Chen <yu.c.chen@intel.com> Acked-by: Juergen Gross <jgross@suse.com> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Marc Zyngier <marc.zyngier@arm.com> Cc: Alok Kataria <akataria@vmware.com> Cc: Joerg Roedel <joro@8bytes.org> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Christoph Hellwig <hch@lst.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Rui Zhang <rui.zhang@intel.com> Cc: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Arjan van de Ven <arjan@linux.intel.com> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Len Brown <lenb@kernel.org> Link: https://lkml.kernel.org/r/20170913213153.279468022@linutronix.de
Diffstat (limited to 'kernel/irq/matrix.c')
-rw-r--r--kernel/irq/matrix.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/kernel/irq/matrix.c b/kernel/irq/matrix.c
index 7b2b4fbde1e2..a3cbbc8191c5 100644
--- a/kernel/irq/matrix.c
+++ b/kernel/irq/matrix.c
@@ -36,6 +36,9 @@ struct irq_matrix {
36 unsigned long system_map[IRQ_MATRIX_SIZE]; 36 unsigned long system_map[IRQ_MATRIX_SIZE];
37}; 37};
38 38
39#define CREATE_TRACE_POINTS
40#include <trace/events/irq_matrix.h>
41
39/** 42/**
40 * irq_alloc_matrix - Allocate a irq_matrix structure and initialize it 43 * irq_alloc_matrix - Allocate a irq_matrix structure and initialize it
41 * @matrix_bits: Number of matrix bits must be <= IRQ_MATRIX_BITS 44 * @matrix_bits: Number of matrix bits must be <= IRQ_MATRIX_BITS
@@ -84,6 +87,7 @@ void irq_matrix_online(struct irq_matrix *m)
84 m->global_available += cm->available; 87 m->global_available += cm->available;
85 cm->online = true; 88 cm->online = true;
86 m->online_maps++; 89 m->online_maps++;
90 trace_irq_matrix_online(m);
87} 91}
88 92
89/** 93/**
@@ -98,6 +102,7 @@ void irq_matrix_offline(struct irq_matrix *m)
98 m->global_available -= cm->available; 102 m->global_available -= cm->available;
99 cm->online = false; 103 cm->online = false;
100 m->online_maps--; 104 m->online_maps--;
105 trace_irq_matrix_offline(m);
101} 106}
102 107
103static unsigned int matrix_alloc_area(struct irq_matrix *m, struct cpumap *cm, 108static unsigned int matrix_alloc_area(struct irq_matrix *m, struct cpumap *cm,
@@ -145,6 +150,8 @@ void irq_matrix_assign_system(struct irq_matrix *m, unsigned int bit,
145 } 150 }
146 if (bit >= m->alloc_start && bit < m->alloc_end) 151 if (bit >= m->alloc_start && bit < m->alloc_end)
147 m->systembits_inalloc++; 152 m->systembits_inalloc++;
153
154 trace_irq_matrix_assign_system(bit, m);
148} 155}
149 156
150/** 157/**
@@ -172,6 +179,7 @@ int irq_matrix_reserve_managed(struct irq_matrix *m, const struct cpumask *msk)
172 cm->available--; 179 cm->available--;
173 m->global_available--; 180 m->global_available--;
174 } 181 }
182 trace_irq_matrix_reserve_managed(bit, cpu, m, cm);
175 } 183 }
176 return 0; 184 return 0;
177cleanup: 185cleanup:
@@ -221,6 +229,7 @@ void irq_matrix_remove_managed(struct irq_matrix *m, const struct cpumask *msk)
221 cm->available++; 229 cm->available++;
222 m->global_available++; 230 m->global_available++;
223 } 231 }
232 trace_irq_matrix_remove_managed(bit, cpu, m, cm);
224 } 233 }
225} 234}
226 235
@@ -242,6 +251,7 @@ int irq_matrix_alloc_managed(struct irq_matrix *m, unsigned int cpu)
242 set_bit(bit, cm->alloc_map); 251 set_bit(bit, cm->alloc_map);
243 cm->allocated++; 252 cm->allocated++;
244 m->total_allocated++; 253 m->total_allocated++;
254 trace_irq_matrix_alloc_managed(bit, cpu, m, cm);
245 return bit; 255 return bit;
246} 256}
247 257
@@ -264,6 +274,7 @@ void irq_matrix_assign(struct irq_matrix *m, unsigned int bit)
264 m->total_allocated++; 274 m->total_allocated++;
265 cm->available--; 275 cm->available--;
266 m->global_available--; 276 m->global_available--;
277 trace_irq_matrix_assign(bit, smp_processor_id(), m, cm);
267} 278}
268 279
269/** 280/**
@@ -282,6 +293,7 @@ void irq_matrix_reserve(struct irq_matrix *m)
282 pr_warn("Interrupt reservation exceeds available resources\n"); 293 pr_warn("Interrupt reservation exceeds available resources\n");
283 294
284 m->global_reserved++; 295 m->global_reserved++;
296 trace_irq_matrix_reserve(m);
285} 297}
286 298
287/** 299/**
@@ -296,6 +308,7 @@ void irq_matrix_reserve(struct irq_matrix *m)
296void irq_matrix_remove_reserved(struct irq_matrix *m) 308void irq_matrix_remove_reserved(struct irq_matrix *m)
297{ 309{
298 m->global_reserved--; 310 m->global_reserved--;
311 trace_irq_matrix_remove_reserved(m);
299} 312}
300 313
301/** 314/**
@@ -326,6 +339,7 @@ int irq_matrix_alloc(struct irq_matrix *m, const struct cpumask *msk,
326 if (reserved) 339 if (reserved)
327 m->global_reserved--; 340 m->global_reserved--;
328 *mapped_cpu = cpu; 341 *mapped_cpu = cpu;
342 trace_irq_matrix_alloc(bit, cpu, m, cm);
329 return bit; 343 return bit;
330 } 344 }
331 } 345 }
@@ -357,6 +371,7 @@ void irq_matrix_free(struct irq_matrix *m, unsigned int cpu,
357 m->global_available++; 371 m->global_available++;
358 } 372 }
359 } 373 }
374 trace_irq_matrix_free(bit, cpu, m, cm);
360} 375}
361 376
362/** 377/**