~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/testing/selftests/powerpc/pmu/ebb/ebb.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  * Copyright 2014, Michael Ellerman, IBM Corp.
  4  */
  5 
  6 #ifndef _SELFTESTS_POWERPC_PMU_EBB_EBB_H
  7 #define _SELFTESTS_POWERPC_PMU_EBB_EBB_H
  8 
  9 #include "../event.h"
 10 #include "../lib.h"
 11 #include "trace.h"
 12 #include "reg.h"
 13 
 14 #define PMC_INDEX(pmc)  ((pmc)-1)
 15 
 16 #define NUM_PMC_VALUES  128
 17 
 18 struct ebb_state
 19 {
 20         struct {
 21                 u64 pmc_count[6];
 22                 volatile int ebb_count;
 23                 int spurious;
 24                 int negative;
 25                 int no_overflow;
 26         } stats;
 27 
 28         bool pmc_enable[6];
 29         struct trace_buffer *trace;
 30 };
 31 
 32 extern struct ebb_state ebb_state;
 33 
 34 #define COUNTER_OVERFLOW 0x80000000ull
 35 
 36 static inline uint32_t pmc_sample_period(uint32_t value)
 37 {
 38         return COUNTER_OVERFLOW - value;
 39 }
 40 
 41 static inline void ebb_enable_pmc_counting(int pmc)
 42 {
 43         ebb_state.pmc_enable[PMC_INDEX(pmc)] = true;
 44 }
 45 
 46 bool ebb_check_count(int pmc, u64 sample_period, int fudge);
 47 void event_leader_ebb_init(struct event *e);
 48 void event_ebb_init(struct event *e);
 49 void event_bhrb_init(struct event *e, unsigned ifm);
 50 void setup_ebb_handler(void (*callee)(void));
 51 void standard_ebb_callee(void);
 52 int ebb_event_enable(struct event *e);
 53 void ebb_global_enable(void);
 54 void ebb_global_disable(void);
 55 bool ebb_is_supported(void);
 56 void ebb_freeze_pmcs(void);
 57 void ebb_unfreeze_pmcs(void);
 58 int count_pmc(int pmc, uint32_t sample_period);
 59 void dump_ebb_state(void);
 60 void dump_summary_ebb_state(void);
 61 void dump_ebb_hw_state(void);
 62 void clear_ebb_stats(void);
 63 void write_pmc(int pmc, u64 value);
 64 u64 read_pmc(int pmc);
 65 void reset_ebb_with_clear_mask(unsigned long mmcr0_clear_mask);
 66 void reset_ebb(void);
 67 int ebb_check_mmcr0(void);
 68 
 69 extern u64 sample_period;
 70 
 71 int core_busy_loop(void);
 72 int ebb_child(union pipe read_pipe, union pipe write_pipe);
 73 int catch_sigill(void (*func)(void));
 74 void write_pmc1(void);
 75 
 76 #endif /* _SELFTESTS_POWERPC_PMU_EBB_EBB_H */
 77 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php