This file is indexed.

/usr/include/fut.h is in libfxt-dev 0.3.0-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
/**************************************
 * DO NOT EDIT THIS FILE              *
 * File autogenerated from a template *
 * DO NOT EDIT THIS FILE              *
 **************************************/
/*	fut.h */
/*
 * PM2: Parallel Multithreaded Machine
 * Copyright (C) 2001 "the PM2 team" (see AUTHORS file)
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or (at
 * your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 */


#ifndef __FUT_H__
#define __FUT_H__

/*	fut = Fast User Tracing */

#ifdef MARCEL
#  include "sys/marcel_flags.h"
#endif
#include <stdarg.h>
#include <stdint.h>

#include "fxt.h"

/*	Macros for use from within the kernel */
#ifndef __ASSEMBLY__
extern volatile unsigned int fut_active;
#endif

#if defined(CONFIG_FUT)

/***********************************************/
/* Les macros 
 *
 * FUT_CODE(code, nb_param) : calcul du code avec décalage
 *   nécessaire pour :
 *     FUT_RAW_PROBEx(...)
 *     FUT_*_PROBE(...)    [avec * dans 'RAW' 'DO' 'FULL' et ''] 
 *   mais pas pour :
 *     FUT_*_PROBEx(...)   [avec * dans 'DO' 'FULL' et ''] 
 *
 * FUT_SIZE(nb_param) : calcul de la taille de la structure
 *
 * FUT_RAW_PROBEx(fut_code, ...) : fut_code est déjà décalé
 * FUT_DO_PROBEx(code, ...) : code n'est pas encode décalé
 * FUT_FULL_PROBEx(keymask, code, ...) : enregistre si le keymask est actif
 * FUT_PROBEx(keymask, code, ...) : idem, sauf avec CONFIG_FUT_TIME_ONLY 
 *                              (dans ce cas, on enregistre aucun paramètre)
 *
 * FUT_*_PROBE([keymask,] fut_code, ...) : nombre variable d'arguments
 *                                         fut_code est déjà décalé
 */


/**************************************
 * DO NOT EDIT THIS FILE              *
 * File autogenerated from a template *
 * DO NOT EDIT THIS FILE              *
 **************************************/


#define FUT_CODE(CODE, n) ((((unsigned long)(CODE))<<8) | ((n) + 1))
#define FUT_SIZE(n) (sizeof(fxt_trace_user_raw_t)+(n)*sizeof(long))
#define FUT_STRLEN(s) ((strlen(s)+sizeof(long)-1)/sizeof(long))

#define FUT_NEEDS_COMMIT

#define FUT_RAW_PROBE0(CODE) do {		\
		if(fut_active) {					\
			unsigned long *__args __attribute__((unused))=	\
				fut_getstampedbuffer(CODE,		\
						     FUT_SIZE(0)); \
							\
			fut_commitstampedbuffer(FUT_SIZE(0)); \
		}							\
	} while (0)

#define FUT_RAW_PROBE0STR(CODE,S) do {		\
		if(fut_active) {					\
			const char *__s = (S);				\
			size_t __slen = strlen(__s);			\
			size_t __max = (FXT_MAX_PARAMS - 0) * sizeof(unsigned long); \
			size_t __len = __slen > __max ? __max : __slen;	\
			unsigned __nbargs_str = (__len + sizeof(unsigned long) - 1) / sizeof (unsigned long); \
			unsigned __nbargs = 0 + __nbargs_str;	\
			unsigned long *__args =				\
				fut_getstampedbuffer(FUT_CODE(CODE, __nbargs), FUT_SIZE(__nbargs)); \
							\
			memcpy(__args, __s, __len);				\
			memset((void*)__args+__len, 0, __nbargs_str*sizeof(long)-__len);	\
			fut_commitstampedbuffer(FUT_SIZE(__nbargs)); \
		}							\
	} while (0)

#define FUT_RAW_PROBE1(CODE,P1) do {		\
		if(fut_active) {					\
			unsigned long *__args __attribute__((unused))=	\
				fut_getstampedbuffer(CODE,		\
						     FUT_SIZE(1)); \
			*(__args++)=(unsigned long)(P1);				\
			fut_commitstampedbuffer(FUT_SIZE(1)); \
		}							\
	} while (0)

#define FUT_RAW_PROBE1STR(CODE,P1,S) do {		\
		if(fut_active) {					\
			const char *__s = (S);				\
			size_t __slen = strlen(__s);			\
			size_t __max = (FXT_MAX_PARAMS - 1) * sizeof(unsigned long); \
			size_t __len = __slen > __max ? __max : __slen;	\
			unsigned __nbargs_str = (__len + sizeof(unsigned long) - 1) / sizeof (unsigned long); \
			unsigned __nbargs = 1 + __nbargs_str;	\
			unsigned long *__args =				\
				fut_getstampedbuffer(FUT_CODE(CODE, __nbargs), FUT_SIZE(__nbargs)); \
			*(__args++)=(unsigned long)(P1);				\
			memcpy(__args, __s, __len);				\
			memset((void*)__args+__len, 0, __nbargs_str*sizeof(long)-__len);	\
			fut_commitstampedbuffer(FUT_SIZE(__nbargs)); \
		}							\
	} while (0)

#define FUT_RAW_PROBE2(CODE,P1,P2) do {		\
		if(fut_active) {					\
			unsigned long *__args __attribute__((unused))=	\
				fut_getstampedbuffer(CODE,		\
						     FUT_SIZE(2)); \
			*(__args++)=(unsigned long)(P1);*(__args++)=(unsigned long)(P2);				\
			fut_commitstampedbuffer(FUT_SIZE(2)); \
		}							\
	} while (0)

#define FUT_RAW_PROBE2STR(CODE,P1,P2,S) do {		\
		if(fut_active) {					\
			const char *__s = (S);				\
			size_t __slen = strlen(__s);			\
			size_t __max = (FXT_MAX_PARAMS - 2) * sizeof(unsigned long); \
			size_t __len = __slen > __max ? __max : __slen;	\
			unsigned __nbargs_str = (__len + sizeof(unsigned long) - 1) / sizeof (unsigned long); \
			unsigned __nbargs = 2 + __nbargs_str;	\
			unsigned long *__args =				\
				fut_getstampedbuffer(FUT_CODE(CODE, __nbargs), FUT_SIZE(__nbargs)); \
			*(__args++)=(unsigned long)(P1);*(__args++)=(unsigned long)(P2);				\
			memcpy(__args, __s, __len);				\
			memset((void*)__args+__len, 0, __nbargs_str*sizeof(long)-__len);	\
			fut_commitstampedbuffer(FUT_SIZE(__nbargs)); \
		}							\
	} while (0)

#define FUT_RAW_PROBE3(CODE,P1,P2,P3) do {		\
		if(fut_active) {					\
			unsigned long *__args __attribute__((unused))=	\
				fut_getstampedbuffer(CODE,		\
						     FUT_SIZE(3)); \
			*(__args++)=(unsigned long)(P1);*(__args++)=(unsigned long)(P2);*(__args++)=(unsigned long)(P3);				\
			fut_commitstampedbuffer(FUT_SIZE(3)); \
		}							\
	} while (0)

#define FUT_RAW_PROBE3STR(CODE,P1,P2,P3,S) do {		\
		if(fut_active) {					\
			const char *__s = (S);				\
			size_t __slen = strlen(__s);			\
			size_t __max = (FXT_MAX_PARAMS - 3) * sizeof(unsigned long); \
			size_t __len = __slen > __max ? __max : __slen;	\
			unsigned __nbargs_str = (__len + sizeof(unsigned long) - 1) / sizeof (unsigned long); \
			unsigned __nbargs = 3 + __nbargs_str;	\
			unsigned long *__args =				\
				fut_getstampedbuffer(FUT_CODE(CODE, __nbargs), FUT_SIZE(__nbargs)); \
			*(__args++)=(unsigned long)(P1);*(__args++)=(unsigned long)(P2);*(__args++)=(unsigned long)(P3);				\
			memcpy(__args, __s, __len);				\
			memset((void*)__args+__len, 0, __nbargs_str*sizeof(long)-__len);	\
			fut_commitstampedbuffer(FUT_SIZE(__nbargs)); \
		}							\
	} while (0)

#define FUT_RAW_PROBE4(CODE,P1,P2,P3,P4) do {		\
		if(fut_active) {					\
			unsigned long *__args __attribute__((unused))=	\
				fut_getstampedbuffer(CODE,		\
						     FUT_SIZE(4)); \
			*(__args++)=(unsigned long)(P1);*(__args++)=(unsigned long)(P2);*(__args++)=(unsigned long)(P3);*(__args++)=(unsigned long)(P4);				\
			fut_commitstampedbuffer(FUT_SIZE(4)); \
		}							\
	} while (0)

#define FUT_RAW_PROBE4STR(CODE,P1,P2,P3,P4,S) do {		\
		if(fut_active) {					\
			const char *__s = (S);				\
			size_t __slen = strlen(__s);			\
			size_t __max = (FXT_MAX_PARAMS - 4) * sizeof(unsigned long); \
			size_t __len = __slen > __max ? __max : __slen;	\
			unsigned __nbargs_str = (__len + sizeof(unsigned long) - 1) / sizeof (unsigned long); \
			unsigned __nbargs = 4 + __nbargs_str;	\
			unsigned long *__args =				\
				fut_getstampedbuffer(FUT_CODE(CODE, __nbargs), FUT_SIZE(__nbargs)); \
			*(__args++)=(unsigned long)(P1);*(__args++)=(unsigned long)(P2);*(__args++)=(unsigned long)(P3);*(__args++)=(unsigned long)(P4);				\
			memcpy(__args, __s, __len);				\
			memset((void*)__args+__len, 0, __nbargs_str*sizeof(long)-__len);	\
			fut_commitstampedbuffer(FUT_SIZE(__nbargs)); \
		}							\
	} while (0)

#define FUT_RAW_PROBE5(CODE,P1,P2,P3,P4,P5) do {		\
		if(fut_active) {					\
			unsigned long *__args __attribute__((unused))=	\
				fut_getstampedbuffer(CODE,		\
						     FUT_SIZE(5)); \
			*(__args++)=(unsigned long)(P1);*(__args++)=(unsigned long)(P2);*(__args++)=(unsigned long)(P3);*(__args++)=(unsigned long)(P4);*(__args++)=(unsigned long)(P5);				\
			fut_commitstampedbuffer(FUT_SIZE(5)); \
		}							\
	} while (0)

#define FUT_RAW_PROBE5STR(CODE,P1,P2,P3,P4,P5,S) do {		\
		if(fut_active) {					\
			const char *__s = (S);				\
			size_t __slen = strlen(__s);			\
			size_t __max = (FXT_MAX_PARAMS - 5) * sizeof(unsigned long); \
			size_t __len = __slen > __max ? __max : __slen;	\
			unsigned __nbargs_str = (__len + sizeof(unsigned long) - 1) / sizeof (unsigned long); \
			unsigned __nbargs = 5 + __nbargs_str;	\
			unsigned long *__args =				\
				fut_getstampedbuffer(FUT_CODE(CODE, __nbargs), FUT_SIZE(__nbargs)); \
			*(__args++)=(unsigned long)(P1);*(__args++)=(unsigned long)(P2);*(__args++)=(unsigned long)(P3);*(__args++)=(unsigned long)(P4);*(__args++)=(unsigned long)(P5);				\
			memcpy(__args, __s, __len);				\
			memset((void*)__args+__len, 0, __nbargs_str*sizeof(long)-__len);	\
			fut_commitstampedbuffer(FUT_SIZE(__nbargs)); \
		}							\
	} while (0)

#define FUT_RAW_PROBE6(CODE,P1,P2,P3,P4,P5,P6) do {		\
		if(fut_active) {					\
			unsigned long *__args __attribute__((unused))=	\
				fut_getstampedbuffer(CODE,		\
						     FUT_SIZE(6)); \
			*(__args++)=(unsigned long)(P1);*(__args++)=(unsigned long)(P2);*(__args++)=(unsigned long)(P3);*(__args++)=(unsigned long)(P4);*(__args++)=(unsigned long)(P5);*(__args++)=(unsigned long)(P6);				\
			fut_commitstampedbuffer(FUT_SIZE(6)); \
		}							\
	} while (0)

#define FUT_RAW_PROBE6STR(CODE,P1,P2,P3,P4,P5,P6,S) do {		\
		if(fut_active) {					\
			const char *__s = (S);				\
			size_t __slen = strlen(__s);			\
			size_t __max = (FXT_MAX_PARAMS - 6) * sizeof(unsigned long); \
			size_t __len = __slen > __max ? __max : __slen;	\
			unsigned __nbargs_str = (__len + sizeof(unsigned long) - 1) / sizeof (unsigned long); \
			unsigned __nbargs = 6 + __nbargs_str;	\
			unsigned long *__args =				\
				fut_getstampedbuffer(FUT_CODE(CODE, __nbargs), FUT_SIZE(__nbargs)); \
			*(__args++)=(unsigned long)(P1);*(__args++)=(unsigned long)(P2);*(__args++)=(unsigned long)(P3);*(__args++)=(unsigned long)(P4);*(__args++)=(unsigned long)(P5);*(__args++)=(unsigned long)(P6);				\
			memcpy(__args, __s, __len);				\
			memset((void*)__args+__len, 0, __nbargs_str*sizeof(long)-__len);	\
			fut_commitstampedbuffer(FUT_SIZE(__nbargs)); \
		}							\
	} while (0)

#define FUT_RAW_PROBE7(CODE,P1,P2,P3,P4,P5,P6,P7) do {		\
		if(fut_active) {					\
			unsigned long *__args __attribute__((unused))=	\
				fut_getstampedbuffer(CODE,		\
						     FUT_SIZE(7)); \
			*(__args++)=(unsigned long)(P1);*(__args++)=(unsigned long)(P2);*(__args++)=(unsigned long)(P3);*(__args++)=(unsigned long)(P4);*(__args++)=(unsigned long)(P5);*(__args++)=(unsigned long)(P6);*(__args++)=(unsigned long)(P7);				\
			fut_commitstampedbuffer(FUT_SIZE(7)); \
		}							\
	} while (0)

#define FUT_RAW_PROBE7STR(CODE,P1,P2,P3,P4,P5,P6,P7,S) do {		\
		if(fut_active) {					\
			const char *__s = (S);				\
			size_t __slen = strlen(__s);			\
			size_t __max = (FXT_MAX_PARAMS - 7) * sizeof(unsigned long); \
			size_t __len = __slen > __max ? __max : __slen;	\
			unsigned __nbargs_str = (__len + sizeof(unsigned long) - 1) / sizeof (unsigned long); \
			unsigned __nbargs = 7 + __nbargs_str;	\
			unsigned long *__args =				\
				fut_getstampedbuffer(FUT_CODE(CODE, __nbargs), FUT_SIZE(__nbargs)); \
			*(__args++)=(unsigned long)(P1);*(__args++)=(unsigned long)(P2);*(__args++)=(unsigned long)(P3);*(__args++)=(unsigned long)(P4);*(__args++)=(unsigned long)(P5);*(__args++)=(unsigned long)(P6);*(__args++)=(unsigned long)(P7);				\
			memcpy(__args, __s, __len);				\
			memset((void*)__args+__len, 0, __nbargs_str*sizeof(long)-__len);	\
			fut_commitstampedbuffer(FUT_SIZE(__nbargs)); \
		}							\
	} while (0)

#define FUT_RAW_PROBESTR(CODE,S) do {					\
		if(fut_active) {					\
			const char *__s = (S);				\
			size_t __len = strlen(__s);			\
			size_t __n = FUT_STRLEN(__s);			\
			unsigned long *__args __attribute__((unused)) =	\
				fut_getstampedbuffer(CODE, FUT_SIZE(__n)); \
			memcpy(__args, __s, __len);			\
			memset((void*)__args+__len, 0, __n*sizeof(long)-__len);	\
			fut_commitstampedbuffer(FUT_SIZE(__n)); \
		}							\
	} while (0)

#define FUT_DO_PROBE0(CODE) do { \
        FUT_RAW_PROBE0(FUT_CODE(CODE, 0)); \
} while (0)

#define FUT_DO_PROBE0STR(CODE,S) do { \
        FUT_RAW_PROBE0STR(CODE ,S); \
} while (0)

#define FUT_DO_PROBE1(CODE,P1) do { \
        FUT_RAW_PROBE1(FUT_CODE(CODE, 1),P1); \
} while (0)

#define FUT_DO_PROBE1STR(CODE,P1,S) do { \
        FUT_RAW_PROBE1STR(CODE ,P1,S); \
} while (0)

#define FUT_DO_PROBE2(CODE,P1,P2) do { \
        FUT_RAW_PROBE2(FUT_CODE(CODE, 2),P1,P2); \
} while (0)

#define FUT_DO_PROBE2STR(CODE,P1,P2,S) do { \
        FUT_RAW_PROBE2STR(CODE ,P1,P2,S); \
} while (0)

#define FUT_DO_PROBE3(CODE,P1,P2,P3) do { \
        FUT_RAW_PROBE3(FUT_CODE(CODE, 3),P1,P2,P3); \
} while (0)

#define FUT_DO_PROBE3STR(CODE,P1,P2,P3,S) do { \
        FUT_RAW_PROBE3STR(CODE ,P1,P2,P3,S); \
} while (0)

#define FUT_DO_PROBE4(CODE,P1,P2,P3,P4) do { \
        FUT_RAW_PROBE4(FUT_CODE(CODE, 4),P1,P2,P3,P4); \
} while (0)

#define FUT_DO_PROBE4STR(CODE,P1,P2,P3,P4,S) do { \
        FUT_RAW_PROBE4STR(CODE ,P1,P2,P3,P4,S); \
} while (0)

#define FUT_DO_PROBE5(CODE,P1,P2,P3,P4,P5) do { \
        FUT_RAW_PROBE5(FUT_CODE(CODE, 5),P1,P2,P3,P4,P5); \
} while (0)

#define FUT_DO_PROBE5STR(CODE,P1,P2,P3,P4,P5,S) do { \
        FUT_RAW_PROBE5STR(CODE ,P1,P2,P3,P4,P5,S); \
} while (0)

#define FUT_DO_PROBE6(CODE,P1,P2,P3,P4,P5,P6) do { \
        FUT_RAW_PROBE6(FUT_CODE(CODE, 6),P1,P2,P3,P4,P5,P6); \
} while (0)

#define FUT_DO_PROBE6STR(CODE,P1,P2,P3,P4,P5,P6,S) do { \
        FUT_RAW_PROBE6STR(CODE ,P1,P2,P3,P4,P5,P6,S); \
} while (0)

#define FUT_DO_PROBE7(CODE,P1,P2,P3,P4,P5,P6,P7) do { \
        FUT_RAW_PROBE7(FUT_CODE(CODE, 7),P1,P2,P3,P4,P5,P6,P7); \
} while (0)

#define FUT_DO_PROBE7STR(CODE,P1,P2,P3,P4,P5,P6,P7,S) do { \
        FUT_RAW_PROBE7STR(CODE ,P1,P2,P3,P4,P5,P6,P7,S); \
} while (0)

#define FUT_DO_PROBESTR(CODE,S) do { \
	FUT_RAW_PROBESTR(FUT_CODE(CODE, FUT_STRLEN(__s)), S); \
} while (0)

/******************************************************/
/* NEVER call fut_getstampedbuffer or                 */
/* fut_commitstampedbuffer directly                   */
/* Interface can change without forewarning           */
/******************************************************/
extern unsigned long* fut_getstampedbuffer(unsigned long code, int size);
extern unsigned long* fut_commitstampedbuffer(int size);

/* This can be overriden by the user */
extern uint64_t fut_getstamp(void);

inline static void
#ifndef __cplusplus
__attribute__((no_instrument_function))
#endif
FUT_RAW_PROBE(unsigned long code, ...) {
	if(fut_active) {		
	int nb=(code&0xff)-1, orig_nb = nb;
        unsigned long *args=fut_getstampedbuffer(code, FUT_SIZE(nb));
	va_list list;

	va_start(list, code);
	while (nb--) {
		*(args++)=va_arg(list, unsigned long);
	}
	va_end(list);
	fut_commitstampedbuffer(FUT_SIZE(orig_nb));
	} 
}
#define FUT_DO_PROBE(CODE, ...) do { \
        FUT_RAW_PROBE(CODE , ##__VA_ARGS__); \
} while (0)



#define FUT_FULL_PROBE0(KEYMASK,CODE) do { \
	if( KEYMASK & fut_active ) { \
                FUT_DO_PROBE0(CODE); \
        } \
} while(0)

#define FUT_FULL_PROBE1(KEYMASK,CODE,P1) do { \
	if( KEYMASK & fut_active ) { \
                FUT_DO_PROBE1(CODE,P1); \
        } \
} while(0)

#define FUT_FULL_PROBE2(KEYMASK,CODE,P1,P2) do { \
	if( KEYMASK & fut_active ) { \
                FUT_DO_PROBE2(CODE,P1,P2); \
        } \
} while(0)

#define FUT_FULL_PROBE3(KEYMASK,CODE,P1,P2,P3) do { \
	if( KEYMASK & fut_active ) { \
                FUT_DO_PROBE3(CODE,P1,P2,P3); \
        } \
} while(0)

#define FUT_FULL_PROBE4(KEYMASK,CODE,P1,P2,P3,P4) do { \
	if( KEYMASK & fut_active ) { \
                FUT_DO_PROBE4(CODE,P1,P2,P3,P4); \
        } \
} while(0)

#define FUT_FULL_PROBE5(KEYMASK,CODE,P1,P2,P3,P4,P5) do { \
	if( KEYMASK & fut_active ) { \
                FUT_DO_PROBE5(CODE,P1,P2,P3,P4,P5); \
        } \
} while(0)

#define FUT_FULL_PROBE6(KEYMASK,CODE,P1,P2,P3,P4,P5,P6) do { \
	if( KEYMASK & fut_active ) { \
                FUT_DO_PROBE6(CODE,P1,P2,P3,P4,P5,P6); \
        } \
} while(0)

#define FUT_FULL_PROBE7(KEYMASK,CODE,P1,P2,P3,P4,P5,P6,P7) do { \
	if( KEYMASK & fut_active ) { \
                FUT_DO_PROBE7(CODE,P1,P2,P3,P4,P5,P6,P7); \
        } \
} while(0)

#define FUT_FULL_PROBE(KEYMASK,CODE,...) do { \
	if( KEYMASK & fut_active ) { \
                FUT_DO_PROBE(CODE , ##__VA_ARGS__); \
        } \
} while(0)

#define FUT_FULL_PROBESTR(KEYMASK,CODE,S) do { \
	if (KEYMASK & fut_active) { \
		FUT_DO_PROBESTR(CODE,S); \
	} \
} while(0)

#else /* CONFIG_FUT */

#define FUT_DO_PROBE0(CODE)   do {} while (0)
#define FUT_FULL_PROBE0(MASK,CODE) do {} while (0)
#define FUT_DO_PROBE1(CODE,P1)   do {} while (0)
#define FUT_FULL_PROBE1(MASK,CODE,P1) do {} while (0)
#define FUT_DO_PROBE2(CODE,P1,P2)   do {} while (0)
#define FUT_FULL_PROBE2(MASK,CODE,P1,P2) do {} while (0)
#define FUT_DO_PROBE3(CODE,P1,P2,P3)   do {} while (0)
#define FUT_FULL_PROBE3(MASK,CODE,P1,P2,P3) do {} while (0)
#define FUT_DO_PROBE4(CODE,P1,P2,P3,P4)   do {} while (0)
#define FUT_FULL_PROBE4(MASK,CODE,P1,P2,P3,P4) do {} while (0)
#define FUT_DO_PROBE5(CODE,P1,P2,P3,P4,P5)   do {} while (0)
#define FUT_FULL_PROBE5(MASK,CODE,P1,P2,P3,P4,P5) do {} while (0)
#define FUT_DO_PROBE6(CODE,P1,P2,P3,P4,P5,P6)   do {} while (0)
#define FUT_FULL_PROBE6(MASK,CODE,P1,P2,P3,P4,P5,P6) do {} while (0)
#define FUT_DO_PROBE7(CODE,P1,P2,P3,P4,P5,P6,P7)   do {} while (0)
#define FUT_FULL_PROBE7(MASK,CODE,P1,P2,P3,P4,P5,P6,P7) do {} while (0)
#define FUT_DO_PROBE(CODE,...)   do {} while (0)
#define FUT_FULL_PROBE(MASK,CODE,...) do {} while (0)
#define FUT_DO_PROBESTR(CODE,S) do {} while (0)
#define FUT_FULL_PROBESTR(MASK,CODE,S) do {} while (0)

#endif

#if defined(CONFIG_FUT_TIME_ONLY)

#define FUT_PROBE0(KEYMASK,CODE) FUT_FULL_PROBE0(KEYMASK,CODE)
#define FUT_PROBE1(KEYMASK,CODE,P1) FUT_FULL_PROBE0(KEYMASK,CODE)
#define FUT_PROBE2(KEYMASK,CODE,P1,P2) FUT_FULL_PROBE0(KEYMASK,CODE)
#define FUT_PROBE3(KEYMASK,CODE,P1,P2,P3) FUT_FULL_PROBE0(KEYMASK,CODE)
#define FUT_PROBE4(KEYMASK,CODE,P1,P2,P3,P4) FUT_FULL_PROBE0(KEYMASK,CODE)
#define FUT_PROBE5(KEYMASK,CODE,P1,P2,P3,P4,P5) FUT_FULL_PROBE0(KEYMASK,CODE)
#define FUT_PROBE6(KEYMASK,CODE,P1,P2,P3,P4,P5,P6) FUT_FULL_PROBE0(KEYMASK,CODE)
#define FUT_PROBE7(KEYMASK,CODE,P1,P2,P3,P4,P5,P6,P7) FUT_FULL_PROBE0(KEYMASK,CODE)
#define FUT_PROBE(KEYMASK,CODE,...) FUT_FULL_PROBE0(KEYMASK,CODE)
#define FUT_PROBESTR(KEYMASK,CODE,S) FUt_FULL_PROBESTR(KEYMASK,CODE)

#else	/* CONFIG_FUT_TIME_ONLY */

#define FUT_PROBE0(KEYMASK,CODE) FUT_FULL_PROBE0(KEYMASK,CODE)
#define FUT_PROBE1(KEYMASK,CODE,P1) FUT_FULL_PROBE1(KEYMASK,CODE,P1)
#define FUT_PROBE2(KEYMASK,CODE,P1,P2) FUT_FULL_PROBE2(KEYMASK,CODE,P1,P2)
#define FUT_PROBE3(KEYMASK,CODE,P1,P2,P3) FUT_FULL_PROBE3(KEYMASK,CODE,P1,P2,P3)
#define FUT_PROBE4(KEYMASK,CODE,P1,P2,P3,P4) FUT_FULL_PROBE4(KEYMASK,CODE,P1,P2,P3,P4)
#define FUT_PROBE5(KEYMASK,CODE,P1,P2,P3,P4,P5) FUT_FULL_PROBE5(KEYMASK,CODE,P1,P2,P3,P4,P5)
#define FUT_PROBE6(KEYMASK,CODE,P1,P2,P3,P4,P5,P6) FUT_FULL_PROBE6(KEYMASK,CODE,P1,P2,P3,P4,P5,P6)
#define FUT_PROBE7(KEYMASK,CODE,P1,P2,P3,P4,P5,P6,P7) FUT_FULL_PROBE7(KEYMASK,CODE,P1,P2,P3,P4,P5,P6,P7)
#define FUT_PROBE(KEYMASK,CODE,...) FUT_FULL_PROBE(KEYMASK,CODE , ##__VA_ARGS__)
#define FUT_PROBESTR(KEYMASK,CODE,S) FUT_FULL_PROBESTR(KEYMASK,CODE,S)

#endif	/* CONFIG_FUT_TIME_ONLY */


/*	"how" parameter values, analagous to "how" parameters to FKT */
#define FUT_ENABLE		0xCE03		/* for enabling probes with 1's in keymask */
#define FUT_DISABLE		0xCE04		/* for disabling probes with 1's in keymask */
#define FUT_SETMASK		0xCE05		/* for enabling 1's, disabling 0's in keymask */

/*	Simple keymasks */
#define FUT_KEYMASK0				0x00000001
#define FUT_KEYMASK1				0x00000002
#define FUT_KEYMASK2				0x00000004
#define FUT_KEYMASK3				0x00000008
#define FUT_KEYMASK4				0x00000010
#define FUT_KEYMASK5				0x00000020
#define FUT_KEYMASK6				0x00000040
#define FUT_KEYMASK7				0x00000080
#define FUT_KEYMASK8				0x00000100
#define FUT_KEYMASK9				0x00000200
#define FUT_KEYMASK10				0x00000400
#define FUT_KEYMASK11				0x00000800
#define FUT_KEYMASK12				0x00001000
#define FUT_KEYMASK13				0x00002000
#define FUT_KEYMASK14				0x00004000
#define FUT_KEYMASK15				0x00008000
#define FUT_KEYMASK16				0x00010000
#define FUT_KEYMASK17				0x00020000
#define FUT_KEYMASK18				0x00040000
#define FUT_KEYMASK19				0x00080000
#define FUT_KEYMASK20				0x00100000
#define FUT_KEYMASK21				0x00200000
#define FUT_KEYMASK22				0x00400000
#define FUT_KEYMASK23				0x00800000
#define FUT_KEYMASK24				0x01000000
#define FUT_KEYMASK25				0x02000000
#define FUT_KEYMASK26				0x04000000
#define FUT_KEYMASK27				0x08000000
#define FUT_KEYMASK28				0x10000000
#define FUT_KEYMASK29				0x20000000
#define FUT_KEYMASK30				0x40000000
#define FUT_KEYMASK31				0x80000000
#define FUT_KEYMASKALL				0xffffffff

#define FUT_GCC_INSTRUMENT_KEYMASK	FUT_KEYMASK29


/*	Fixed parameters of the fut coding scheme */
#define FUT_GENERIC_EXIT_OFFSET		0x100	/* exit this much above entry */

#define FUT_UNPAIRED_LIMIT_CODE		0xf000	/* all unpaired codes above this limit */

/*	Codes for fut use */
#define FUT_SETUP_CODE				0xffff
#define FUT_KEYCHANGE_CODE			0xfffe
#define FUT_RESET_CODE				0xfffd
#define FUT_CALIBRATE0_CODE			0xfffc
#define FUT_CALIBRATE1_CODE			0xfffb
#define FUT_CALIBRATE2_CODE			0xfffa

#define FUT_THREAD_BIRTH_CODE                   0xfff9
#define FUT_THREAD_DEATH_CODE                   0xfff8
#define FUT_SET_THREAD_NAME_CODE                0xfff7

#define FUT_NEW_LWP_CODE                        0xfff6

#define FUT_START_FLUSH_CODE                    0xfff5
#define FUT_STOP_FLUSH_CODE                     0xfff4

#define FUT_RQS_NEWLEVEL			0xffef
#define FUT_RQS_NEWLWPRQ			0xffee
#define FUT_RQS_NEWRQ				0xffed

#define FUT_SWITCH_TO_CODE			0x31a

#define FUT_MAIN_ENTRY_CODE			0x301
#define FUT_MAIN_EXIT_CODE			0x401

/* -finstrument-functions code */
#define FUT_GCC_INSTRUMENT_ENTRY_CODE	0x320
#define FUT_GCC_INSTRUMENT_EXIT_CODE	0x420

#ifndef __ASSEMBLY__
extern unsigned long * volatile fut_next_slot;
extern unsigned long * volatile fut_first_slot;
extern unsigned long * volatile fut_last_slot;
extern size_t volatile fut_filled_slot;

extern pthread_spinlock_t fut_slot_lock;

extern int fut_setup( unsigned int nints, unsigned int keymask,
			unsigned int threadid );
extern int fut_endup( char *filename );
extern int fut_done(void );
extern int fut_keychange( int how, unsigned int keymask,
			unsigned int threadid );
extern int fut_reset( unsigned int keymask, unsigned int threadid );
extern int fut_getbuffer( int *nints, unsigned long **buffer, unsigned long *next_slot);

extern int fut_header( unsigned long head, ... );

extern void enable_fut_flush( void );
extern void disable_fut_flush( void );

extern void fut_set_filename( char *filename );

/* activate the recording of thread id */
extern void fut_enable_tid_logging();

/* disactivate the recording of thread id */
extern void fut_disable_tid_logging();
#endif


#endif