HPCToolkit
ss_obj.h
Go to the documentation of this file.
1 // -*-Mode: C++;-*- // technically C99
2 
3 // * BeginRiceCopyright *****************************************************
4 //
5 // $HeadURL$
6 // $Id$
7 //
8 // --------------------------------------------------------------------------
9 // Part of HPCToolkit (hpctoolkit.org)
10 //
11 // Information about sources of support for research and development of
12 // HPCToolkit is at 'hpctoolkit.org' and in 'README.Acknowledgments'.
13 // --------------------------------------------------------------------------
14 //
15 // Copyright ((c)) 2002-2019, Rice University
16 // All rights reserved.
17 //
18 // Redistribution and use in source and binary forms, with or without
19 // modification, are permitted provided that the following conditions are
20 // met:
21 //
22 // * Redistributions of source code must retain the above copyright
23 // notice, this list of conditions and the following disclaimer.
24 //
25 // * Redistributions in binary form must reproduce the above copyright
26 // notice, this list of conditions and the following disclaimer in the
27 // documentation and/or other materials provided with the distribution.
28 //
29 // * Neither the name of Rice University (RICE) nor the names of its
30 // contributors may be used to endorse or promote products derived from
31 // this software without specific prior written permission.
32 //
33 // This software is provided by RICE and contributors "as is" and any
34 // express or implied warranties, including, but not limited to, the
35 // implied warranties of merchantability and fitness for a particular
36 // purpose are disclaimed. In no event shall RICE or contributors be
37 // liable for any direct, indirect, incidental, special, exemplary, or
38 // consequential damages (including, but not limited to, procurement of
39 // substitute goods or services; loss of use, data, or profits; or
40 // business interruption) however caused and on any theory of liability,
41 // whether in contract, strict liability, or tort (including negligence
42 // or otherwise) arising in any way out of the use of this software, even
43 // if advised of the possibility of such damage.
44 //
45 // ******************************************************* EndRiceCopyright *
46 
47 
48 #undef _TPx
49 #undef _T3
50 #undef _make_id
51 #undef _st
52 #undef _st1
53 
54 #define _TPx(a,b,c) a ## b ## c
55 #define _T3(a, b, c) _TPx(a, b, c)
56 #define _make_id(tpl) _T3 tpl
57 
58 #define _st(n) # n
59 #define _st1(n) _st(n)
60 
61 #undef obj_name
62 #undef ss_str
63 #undef reg_fn_name
64 
65 #ifndef ss_sort_order
66 #define ss_sort_order 50
67 #endif
68 
69 #include "ss-obj-name.h"
70 
71 #define obj_name() SS_OBJ_NAME(ss_name)
72 #define ss_str _st1(ss_name)
73 #define reg_fn_name _make_id((,ss_name,_obj_reg))
74 
76  // common methods
77 
78  .add_event = hpcrun_ss_add_event,
79  .store_event = hpcrun_ss_store_event,
80  .store_event_and_info = hpcrun_ss_store_event_and_info,
81  .store_metric_id = hpcrun_ss_store_metric_id,
82  .get_event_str = hpcrun_ss_get_event_str,
83  .started = hpcrun_ss_started,
84 
85  // specific methods
86 
87  .init = init,
88  .thread_init = thread_init,
89  .thread_init_action = thread_init_action,
90  .start = start,
91  .thread_fini_action = thread_fini_action,
92  .stop = stop,
93  .shutdown = shutdown,
94  .supports_event = supports_event,
95  .process_event_list = process_event_list,
96  .gen_event_set = gen_event_set,
97  .display_events = display_events,
98 
99  // data
100  .evl = {
101  .evl_spec = {[0] = '\0'},
102  .nevents = 0
103  },
104  .sel_idx = -1,
105  .name = ss_str,
106  .cls = ss_cls,
107  .state = UNINIT,
108  .sort_order = ss_sort_order,
109 };
110 
111 
112 /******************************************************************************
113  * constructor
114  *****************************************************************************/
115 
116 void
118 {
120 }
121 
122 #undef ss_str
123 #undef reg_fn_name
124 
125 #undef _st
126 #undef _st1
#define obj_name()
Definition: ss_obj.h:71
void SS_OBJ_CONSTRUCTOR() ss_name(void)
Definition: ss_obj.h:117
#define ss_str
Definition: ss_obj.h:72
#define SS_OBJ_CONSTRUCTOR(ssname)
Definition: ss-obj-name.h:58
#define ss_sort_order
Definition: ss_obj.h:66
void hpcrun_ss_register(sample_source_t *src)
#define ss_cls
Definition: cuda.c:422