perf_event_fsl_emb.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Performance event support - Freescale embedded specific definitions.
  3. *
  4. * Copyright 2008-2009 Paul Mackerras, IBM Corporation.
  5. * Copyright 2010 Freescale Semiconductor, Inc.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation; either version
  10. * 2 of the License, or (at your option) any later version.
  11. */
  12. #include <linux/types.h>
  13. #include <asm/hw_irq.h>
  14. #define MAX_HWEVENTS 6
  15. /* event flags */
  16. #define FSL_EMB_EVENT_VALID 1
  17. #define FSL_EMB_EVENT_RESTRICTED 2
  18. /* upper half of event flags is PMLCb */
  19. #define FSL_EMB_EVENT_THRESHMUL 0x0000070000000000ULL
  20. #define FSL_EMB_EVENT_THRESH 0x0000003f00000000ULL
  21. struct fsl_emb_pmu {
  22. const char *name;
  23. int n_counter; /* total number of counters */
  24. /*
  25. * The number of contiguous counters starting at zero that
  26. * can hold restricted events, or zero if there are no
  27. * restricted events.
  28. *
  29. * This isn't a very flexible method of expressing constraints,
  30. * but it's very simple and is adequate for existing chips.
  31. */
  32. int n_restricted;
  33. /* Returns event flags and PMLCb (FSL_EMB_EVENT_*) */
  34. u64 (*xlate_event)(u64 event_id);
  35. int n_generic;
  36. int *generic_events;
  37. int (*cache_events)[PERF_COUNT_HW_CACHE_MAX]
  38. [PERF_COUNT_HW_CACHE_OP_MAX]
  39. [PERF_COUNT_HW_CACHE_RESULT_MAX];
  40. };
  41. int register_fsl_emb_pmu(struct fsl_emb_pmu *);