HPCToolkit
perfmon-util-dummy.c
Go to the documentation of this file.
1 // -*-Mode: C++;-*- // technically C99
2 
3 // * BeginRiceCopyright *****************************************************
4 //
5 // --------------------------------------------------------------------------
6 // Part of HPCToolkit (hpctoolkit.org)
7 //
8 // Information about sources of support for research and development of
9 // HPCToolkit is at 'hpctoolkit.org' and in 'README.Acknowledgments'.
10 // --------------------------------------------------------------------------
11 //
12 // Copyright ((c)) 2002-2019, Rice University
13 // All rights reserved.
14 //
15 // Redistribution and use in source and binary forms, with or without
16 // modification, are permitted provided that the following conditions are
17 // met:
18 //
19 // * Redistributions of source code must retain the above copyright
20 // notice, this list of conditions and the following disclaimer.
21 //
22 // * Redistributions in binary form must reproduce the above copyright
23 // notice, this list of conditions and the following disclaimer in the
24 // documentation and/or other materials provided with the distribution.
25 //
26 // * Neither the name of Rice University (RICE) nor the names of its
27 // contributors may be used to endorse or promote products derived from
28 // this software without specific prior written permission.
29 //
30 // This software is provided by RICE and contributors "as is" and any
31 // express or implied warranties, including, but not limited to, the
32 // implied warranties of merchantability and fitness for a particular
33 // purpose are disclaimed. In no event shall RICE or contributors be
34 // liable for any direct, indirect, incidental, special, exemplary, or
35 // consequential damages (including, but not limited to, procurement of
36 // substitute goods or services; loss of use, data, or profits; or
37 // business interruption) however caused and on any theory of liability,
38 // whether in contract, strict liability, or tort (including negligence
39 // or otherwise) arising in any way out of the use of this software, even
40 // if advised of the possibility of such damage.
41 //
42 // ******************************************************* EndRiceCopyright *
43 
44 //
45 // Dummy interface for perfmon functions used in linux_perf.c, for the
46 // case that perfmon is not available.
47 //
48 
49 
50 //******************************************************************************
51 // include files
52 //******************************************************************************
53 
54 #include <linux/perf_event.h>
55 #include "perfmon-util.h"
56 #include "perf-util.h"
57 
58 
59 //******************************************************************************
60 // Supported operations
61 //******************************************************************************
62 
68 int
69 pfmu_getEventAttribute(const char *eventname, struct perf_event_attr *event_attr)
70 {
71  return -1;
72 }
73 
74 
75 // return 0 or positive if the event exists, -1 otherwise
76 // if the event exist, code and type are the code and type of the event
77 int
78 pfmu_getEventType(const char *eventname, u64 *code, u64 *type)
79 {
80  return -1;
81 }
82 
83 
84 /*
85  * interface to check if an event is "supported"
86  * "supported" here means, it matches with the perfmon PMU event
87  *
88  * return 0 or positive if the event exists, -1 otherwise
89  */
90 int
91 pfmu_isSupported(const char *eventname)
92 {
93  return -1;
94 }
95 
96 
101 int
103 {
104  return -1;
105 }
106 
107 
108 void
110 {
111  return;
112 }
113 
114 
115 /*
116  * interface function to print the list of supported PMUs
117  */
118 int
120 {
121  return -1;
122 }
int pfmu_getEventType(const char *eventname, u64 *code, u64 *type)
void pfmu_fini()
int pfmu_isSupported(const char *eventname)
int pfmu_init()
int pfmu_showEventList()
__u64 u64
int pfmu_getEventAttribute(const char *eventname, struct perf_event_attr *event_attr)