1    	#undef TRACEPOINT_PROVIDER
2    	#define TRACEPOINT_PROVIDER fsalmem
3    	
4    	#if !defined(GANESHA_LTTNG_FSALMEM_TP_H) || \
5    		defined(TRACEPOINT_HEADER_MULTI_READ)
6    	#define GANESHA_LTTNG_FSALMEM_TP_H
7    	
8    	#include <stdint.h>
9    	#include <lttng/tracepoint.h>
10   	
11   	/**
12   	 * @brief Trace an allocation of an obj
13   	 *
14   	 * @param[in] function	Name of function taking ref
15   	 * @param[in] line	Line number of call
16   	 * @param[in] obj	Address of obj
17   	 * @param[in] name	File name
18   	 */
19   	TRACEPOINT_EVENT(
20   		fsalmem,
21   		mem_alloc,
22   		TP_ARGS(const char *, function,
23   			int, line,
24   			void *, obj,
25   			const char *, name,
26   			uint32_t, refcount),
27   		TP_FIELDS(
28   			ctf_string(function, function)
29   			ctf_integer(int, line, line)
30   			ctf_integer_hex(void *, obj, obj)
31   			ctf_string(name, name)
32   			ctf_integer(uint32_t, refcount, refcount)
33   		)
34   	)
35   	
36   	TRACEPOINT_LOGLEVEL(
37   		fsalmem,
38   		mem_alloc,
39   		TRACE_INFO)
40   	
41   	/**
42   	 * @brief Trace a free of an obj
43   	 *
44   	 * @param[in] function	Name of function releasing ref
45   	 * @param[in] line	Line number of call
46   	 * @param[in] obj	Address of obj
47   	 * @param[in] name	File name
48   	 */
49   	TRACEPOINT_EVENT(
50   		fsalmem,
51   		mem_free,
52   		TP_ARGS(const char *, function,
53   			int, line,
54   			void *, obj,
55   			const char *, name),
56   		TP_FIELDS(
57   			ctf_string(function, function)
58   			ctf_integer(int, line, line)
59   			ctf_integer_hex(void *, obj, obj)
60   			ctf_string(name, name)
61   		)
62   	)
63   	
64   	TRACEPOINT_LOGLEVEL(
65   		fsalmem,
66   		mem_free,
67   		TRACE_INFO)
68   	
69   	/**
70   	 * @brief Trace a lookup of an obj
71   	 *
72   	 * @param[in] function	Name of function releasing ref
73   	 * @param[in] line	Line number of call
74   	 * @param[in] obj	Address of obj
75   	 * @param[in] name	File name
76   	 */
77   	TRACEPOINT_EVENT(
78   		fsalmem,
79   		mem_lookup,
80   		TP_ARGS(const char *, function,
81   			int, line,
82   			void *, obj,
83   			const char *, name),
84   		TP_FIELDS(
85   			ctf_string(function, function)
86   			ctf_integer(int, line, line)
87   			ctf_integer_hex(void *, obj, obj)
88   			ctf_string(name, name)
89   		)
90   	)
91   	
92   	TRACEPOINT_LOGLEVEL(
93   		fsalmem,
94   		mem_lookup,
95   		TRACE_INFO)
96   	
97   	/**
98   	 * @brief Trace a failed free of an obj
99   	 *
100  	 * @param[in] function	Name of function releasing ref
101  	 * @param[in] line	Line number of call
102  	 * @param[in] obj	Address of obj
103  	 * @param[in] inavl	True if inavl
104  	 */
105  	TRACEPOINT_EVENT(
106  		fsalmem,
107  		mem_inuse,
108  		TP_ARGS(const char *, function,
109  			int, line,
110  			void *, obj,
111  			int, numlinks,
112  			int, is_export),
113  		TP_FIELDS(
114  			ctf_string(function, function)
115  			ctf_integer(int, line, line)
116  			ctf_integer_hex(void *, obj, obj)
117  			ctf_integer(int, numlinks, numlinks)
118  			ctf_integer(int, is_export, is_export)
119  		)
120  	)
121  	
122  	TRACEPOINT_LOGLEVEL(
123  		fsalmem,
124  		mem_inuse,
125  		TRACE_INFO)
126  	
127  	/**
128  	 * @brief Trace a getattrs call
129  	 *
130  	 * @param[in] function	Name of function
131  	 * @param[in] line	Line number of call
132  	 * @param[in] obj	Address of obj
133  	 * @param[in] name	File name
134  	 * @param[in] size	Size of file
135  	 * @param[in] numlinks	Number of links
136  	 * @param[in] chg	Change counter
137  	 */
138  	TRACEPOINT_EVENT(
139  		fsalmem,
140  		mem_getattrs,
141  		TP_ARGS(const char *, function,
142  			int, line,
143  			void *, obj,
144  			const char *, name,
145  			uint64_t, size,
146  			uint32_t, numlinks,
147  			uint64_t, chg),
148  		TP_FIELDS(
149  			ctf_string(function, function)
150  			ctf_integer(int, line, line)
151  			ctf_integer_hex(void *, obj, obj)
152  			ctf_string(name, name)
153  			ctf_integer(uint64_t, size, size)
154  			ctf_integer(uint32_t, numlinks, numlinks)
155  			ctf_integer(uint64_t, chg, chg)
156  		)
157  	)
158  	
159  	TRACEPOINT_LOGLEVEL(
160  		fsalmem,
161  		mem_getattrs,
162  		TRACE_INFO)
163  	
164  	
165  	/**
166  	 * @brief Trace a setattrs call
167  	 *
168  	 * @param[in] function	Name of function
169  	 * @param[in] line	Line number of call
170  	 * @param[in] obj	Address of obj
171  	 * @param[in] name	File name
172  	 * @param[in] size	Size of file
173  	 * @param[in] numlinks	Number of links
174  	 * @param[in] chg	Change counter
175  	 */
176  	TRACEPOINT_EVENT(
177  		fsalmem,
178  		mem_setattrs,
179  		TP_ARGS(const char *, function,
180  			int, line,
181  			void *, obj,
182  			const char *, name,
183  			uint64_t, size,
184  			uint32_t, numlinks,
185  			uint64_t, chg),
186  		TP_FIELDS(
187  			ctf_string(function, function)
188  			ctf_integer(int, line, line)
189  			ctf_integer_hex(void *, obj, obj)
190  			ctf_string(name, name)
191  			ctf_integer(uint64_t, size, size)
192  			ctf_integer(uint32_t, numlinks, numlinks)
193  			ctf_integer(uint64_t, chg, chg)
194  		)
195  	)
196  	
197  	TRACEPOINT_LOGLEVEL(
198  		fsalmem,
199  		mem_setattrs,
200  		TRACE_INFO)
201  	
202  	
203  	/**
204  	 * @brief Trace a write call
205  	 *
206  	 * @param[in] function	Name of function
207  	 * @param[in] line	Line number of call
208  	 * @param[in] obj	Address of obj
209  	 * @param[in] name	File name
210  	 * @param[in] size	Size of file
211  	 * @param[in] dsize	Data size of file
212  	 */
(1) Event unsigned_compare: This less-than-zero comparison of an unsigned value is never true. "18446744073709551615UL < 0UL".
213  	TRACEPOINT_EVENT(
214  		fsalmem,
215  		mem_write,
216  		TP_ARGS(const char *, function,
217  			int, line,
218  			void *, obj,
219  			const char *, name,
220  			void *, state,
221  			uint64_t, size,
222  			uint64_t, dsize),
223  		TP_FIELDS(
224  			ctf_string(function, function)
225  			ctf_integer(int, line, line)
226  			ctf_integer_hex(void *, obj, obj)
227  			ctf_string(name, name)
228  			ctf_integer_hex(void *, state, state)
229  			ctf_integer(uint64_t, size, size)
230  			ctf_integer(uint64_t, dsize, dsize)
231  		)
232  	)
233  	
234  	TRACEPOINT_LOGLEVEL(
235  		fsalmem,
236  		mem_write,
237  		TRACE_INFO)
238  	
239  	
240  	/**
241  	 * @brief Trace a read call
242  	 *
243  	 * @param[in] function	Name of function
244  	 * @param[in] line	Line number of call
245  	 * @param[in] obj	Address of obj
246  	 * @param[in] name	File name
247  	 * @param[in] size	Size of file
248  	 * @param[in] dsize	Data size of file
249  	 */
250  	TRACEPOINT_EVENT(
251  		fsalmem,
252  		mem_read,
253  		TP_ARGS(const char *, function,
254  			int, line,
255  			void *, obj,
256  			const char *, name,
257  			void *, state,
258  			uint64_t, size,
259  			uint64_t, dsize),
260  		TP_FIELDS(
261  			ctf_string(function, function)
262  			ctf_integer(int, line, line)
263  			ctf_integer_hex(void *, obj, obj)
264  			ctf_string(name, name)
265  			ctf_integer_hex(void *, state, state)
266  			ctf_integer(uint64_t, size, size)
267  			ctf_integer(uint64_t, dsize, dsize)
268  		)
269  	)
270  	
271  	TRACEPOINT_LOGLEVEL(
272  		fsalmem,
273  		mem_read,
274  		TRACE_INFO)
275  	
276  	
277  	/**
278  	 * @brief Trace an open call
279  	 *
280  	 * @param[in] function	Name of function
281  	 * @param[in] line	Line number of call
282  	 * @param[in] obj	Address of obj
283  	 * @param[in] name	File name
284  	 * @param[in] state	Address of state
285  	 * @param[in] truncated	True if truncated
286  	 * @param[in] setattrs	Pointer of setattrs
287  	 */
288  	TRACEPOINT_EVENT(
289  		fsalmem,
290  		mem_open,
291  		TP_ARGS(const char *, function,
292  			int, line,
293  			void *, obj,
294  			const char *, name,
295  			void *, state,
296  			uint32_t, truncated,
297  			uint32_t, setattrs),
298  		TP_FIELDS(
299  			ctf_string(function, function)
300  			ctf_integer(int, line, line)
301  			ctf_integer_hex(void *, obj, obj)
302  			ctf_string(name, name)
303  			ctf_integer_hex(void *, state, state)
304  			ctf_integer(uint32_t, truncated, truncated)
305  			ctf_integer(uint32_t, setattrs, setattrs)
306  		)
307  	)
308  	
309  	TRACEPOINT_LOGLEVEL(
310  		fsalmem,
311  		mem_open,
312  		TRACE_INFO)
313  	
314  	/**
315  	 * @brief Trace a close call
316  	 *
317  	 * @param[in] function	Name of function
318  	 * @param[in] line	Line number of call
319  	 * @param[in] obj	Address of obj
320  	 * @param[in] name	File name
321  	 * @param[in] state	Address of state
322  	 * @param[in] truncated	True if truncated
323  	 * @param[in] setattrs	Pointer of setattrs
324  	 */
325  	TRACEPOINT_EVENT(
326  		fsalmem,
327  		mem_close,
328  		TP_ARGS(const char *, function,
329  			int, line,
330  			void *, obj,
331  			const char *, name,
332  			void *, state),
333  		TP_FIELDS(
334  			ctf_string(function, function)
335  			ctf_integer(int, line, line)
336  			ctf_integer_hex(void *, obj, obj)
337  			ctf_string(name, name)
338  			ctf_integer_hex(void *, state, state)
339  		)
340  	)
341  	
342  	TRACEPOINT_LOGLEVEL(
343  		fsalmem,
344  		mem_close,
345  		TRACE_INFO)
346  	
347  	/**
348  	 * @brief Trace an creat_handle
349  	 *
350  	 * @param[in] function	Name of function
351  	 * @param[in] line	Line number of call
352  	 * @param[in] obj	Address of obj
353  	 * @param[in] name	File name
354  	 */
355  	TRACEPOINT_EVENT(
356  		fsalmem,
357  		mem_create_handle,
358  		TP_ARGS(const char *, function,
359  			int, line,
360  			void *, obj,
361  			const char *, name),
362  		TP_FIELDS(
363  			ctf_string(function, function)
364  			ctf_integer(int, line, line)
365  			ctf_integer_hex(void *, obj, obj)
366  			ctf_string(name, name)
367  		)
368  	)
369  	
370  	TRACEPOINT_LOGLEVEL(
371  		fsalmem,
372  		mem_create_handle,
373  		TRACE_INFO)
374  	
375  	
376  	/**
377  	 * @brief Trace an alloc_state
378  	 *
379  	 * @param[in] function	Name of function
380  	 * @param[in] line	Line number of call
381  	 * @param[in] state	Address of state
382  	 */
383  	TRACEPOINT_EVENT(
384  		fsalmem,
385  		mem_alloc_state,
386  		TP_ARGS(const char *, function,
387  			int, line,
388  			void *, state),
389  		TP_FIELDS(
390  			ctf_string(function, function)
391  			ctf_integer(int, line, line)
392  			ctf_integer_hex(void *, state, state)
393  		)
394  	)
395  	
396  	TRACEPOINT_LOGLEVEL(
397  		fsalmem,
398  		mem_alloc_state,
399  		TRACE_INFO)
400  	
401  	
402  	
403  	/**
404  	 * @brief Trace a rename
405  	 *
406  	 * @param[in] function	Name of function
407  	 * @param[in] line	Line number of call
408  	 * @param[in] olddir	Name of old directory
409  	 * @param[in] oldname	Name of old file
410  	 * @param[in] newdir	Name of new directory
411  	 * @param[in] newname	Name of new file
412  	 */
413  	TRACEPOINT_EVENT(
414  		fsalmem,
415  		mem_rename,
416  		TP_ARGS(const char *, function,
417  			int, line,
418  			void *, obj,
419  			const char *, olddir,
420  			const char *, oldname,
421  			const char *, newdir,
422  			const char *, newname),
423  		TP_FIELDS(
424  			ctf_string(function, function)
425  			ctf_integer(int, line, line)
426  			ctf_integer_hex(void *, obj, obj)
427  			ctf_string(olddir, olddir)
428  			ctf_string(oldname, oldname)
429  			ctf_string(newdir, newdir)
430  			ctf_string(newname, newname)
431  		)
432  	)
433  	
434  	TRACEPOINT_LOGLEVEL(
435  		fsalmem,
436  		mem_rename,
437  		TRACE_INFO)
438  	
439  	/**
440  	 * @brief Trace a link
441  	 *
442  	 * @param[in] function	Name of function
443  	 * @param[in] line	Line number of call
444  	 * @param[in] olddir	Name of old directory
445  	 * @param[in] oldname	Name of old file
446  	 * @param[in] newdir	Name of new directory
447  	 * @param[in] newname	Name of new file
448  	 */
449  	TRACEPOINT_EVENT(
450  		fsalmem,
451  		mem_link,
452  		TP_ARGS(const char *, function,
453  			int, line,
454  			void *, dir,
455  			const char *, dirname,
456  			void *, file,
457  			const char *, filename,
458  			const char *, newname,
459  			uint32_t, numlinks),
460  		TP_FIELDS(
461  			ctf_string(function, function)
462  			ctf_integer(int, line, line)
463  			ctf_integer_hex(void *, dir, dir)
464  			ctf_string(dirname, dirname)
465  			ctf_integer_hex(void *, file, file)
466  			ctf_string(filename, filename)
467  			ctf_string(newname, newname)
468  			ctf_integer(uint32_t, numlinks, numlinks)
469  		)
470  	)
471  	
472  	TRACEPOINT_LOGLEVEL(
473  		fsalmem,
474  		mem_link,
475  		TRACE_INFO)
476  	
477  	
478  	/**
479  	 * @brief Trace a unlink
480  	 *
481  	 * @param[in] function	Name of function
482  	 * @param[in] line	Line number of call
483  	 * @param[in] olddir	Name of old directory
484  	 * @param[in] oldname	Name of old file
485  	 * @param[in] newdir	Name of new directory
486  	 * @param[in] newname	Name of new file
487  	 */
488  	TRACEPOINT_EVENT(
489  		fsalmem,
490  		mem_unlink,
491  		TP_ARGS(const char *, function,
492  			int, line,
493  			void *, dir,
494  			const char *, dirname,
495  			void *, file,
496  			const char *, filename,
497  			uint32_t, numlinks),
498  		TP_FIELDS(
499  			ctf_string(function, function)
500  			ctf_integer(int, line, line)
501  			ctf_integer_hex(void *, dir, dir)
502  			ctf_string(dirname, dirname)
503  			ctf_integer_hex(void *, file, file)
504  			ctf_string(filename, filename)
505  			ctf_integer(uint32_t, numlinks, numlinks)
506  		)
507  	)
508  	
509  	TRACEPOINT_LOGLEVEL(
510  		fsalmem,
511  		mem_unlink,
512  		TRACE_INFO)
513  	
514  	
515  	/**
516  	 * @brief Trace a get_ref
517  	 *
518  	 * @param[in] function	Name of function
519  	 * @param[in] line	Line number of call
520  	 * @param[in] olddir	Name of old directory
521  	 * @param[in] oldname	Name of old file
522  	 * @param[in] newdir	Name of new directory
523  	 * @param[in] newname	Name of new file
524  	 */
525  	TRACEPOINT_EVENT(
526  		fsalmem,
527  		mem_get_ref,
528  		TP_ARGS(const char *, function,
529  			int, line,
530  			void *, file,
531  			const char *, filename,
532  			uint32_t, refcount),
533  		TP_FIELDS(
534  			ctf_string(function, function)
535  			ctf_integer(int, line, line)
536  			ctf_integer_hex(void *, file, file)
537  			ctf_string(filename, filename)
538  			ctf_integer(uint32_t, refcount, refcount)
539  		)
540  	)
541  	
542  	TRACEPOINT_LOGLEVEL(
543  		fsalmem,
544  		mem_get_ref,
545  		TRACE_INFO)
546  	
547  	/**
548  	 * @brief Trace a put_ref
549  	 *
550  	 * @param[in] function	Name of function
551  	 * @param[in] line	Line number of call
552  	 * @param[in] olddir	Name of old directory
553  	 * @param[in] oldname	Name of old file
554  	 * @param[in] newdir	Name of new directory
555  	 * @param[in] newname	Name of new file
556  	 */
557  	TRACEPOINT_EVENT(
558  		fsalmem,
559  		mem_put_ref,
560  		TP_ARGS(const char *, function,
561  			int, line,
562  			void *, file,
563  			const char *, filename,
564  			uint32_t, refcount),
565  		TP_FIELDS(
566  			ctf_string(function, function)
567  			ctf_integer(int, line, line)
568  			ctf_integer_hex(void *, file, file)
569  			ctf_string(filename, filename)
570  			ctf_integer(uint32_t, refcount, refcount)
571  		)
572  	)
573  	
574  	TRACEPOINT_LOGLEVEL(
575  		fsalmem,
576  		mem_put_ref,
577  		TRACE_INFO)
578  	
579  	
580  	/**
581  	 * @brief Trace a readdir
582  	 *
583  	 * @param[in] function	Name of function
584  	 * @param[in] line	Line number of call
585  	 * @param[in] olddir	Name of old directory
586  	 * @param[in] oldname	Name of old file
587  	 * @param[in] newdir	Name of new directory
588  	 * @param[in] newname	Name of new file
589  	 */
590  	TRACEPOINT_EVENT(
591  		fsalmem,
592  		mem_readdir,
593  		TP_ARGS(const char *, function,
594  			int, line,
595  			void *, dir,
596  			const char *, dirname,
597  			uint64_t, whence),
598  		TP_FIELDS(
599  			ctf_string(function, function)
600  			ctf_integer(int, line, line)
601  			ctf_integer_hex(void *, dir, dir)
602  			ctf_string(dirname, dirname)
603  			ctf_integer(uint64_t, whence, whence)
604  		)
605  	)
606  	
607  	TRACEPOINT_LOGLEVEL(
608  		fsalmem,
609  		mem_readdir,
610  		TRACE_INFO)
611  	
612  	/**
613  	 * @brief Trace a mkdir
614  	 *
615  	 * @param[in] function	Name of function
616  	 * @param[in] line	Line number of call
617  	 * @param[in] dir	Directory handle
618  	 * @param[in] dirname	Name of directory
619  	 * @param[in] newname	Name of new directory
620  	 */
621  	TRACEPOINT_EVENT(
622  		fsalmem,
623  		mem_mkdir,
624  		TP_ARGS(const char *, function,
625  			int, line,
626  			void *, dir,
627  			const char *, dirname,
628  			const char *, newname),
629  		TP_FIELDS(
630  			ctf_string(function, function)
631  			ctf_integer(int, line, line)
632  			ctf_integer_hex(void *, dir, dir)
633  			ctf_string(dirname, dirname)
634  			ctf_string(newname, newname)
635  		)
636  	)
637  	
638  	TRACEPOINT_LOGLEVEL(
639  		fsalmem,
640  		mem_mkdir,
641  		TRACE_INFO)
642  	
643  	
644  	#endif /* GANESHA_LTTNG_FSALMEM_TP_H */
645  	
646  	#undef TRACEPOINT_INCLUDE
647  	#define TRACEPOINT_INCLUDE "gsh_lttng/fsal_mem.h"
648  	
649  	#include <lttng/tracepoint-event.h>
650