Lines Matching +full:c +full:- +full:define +full:- +full:name
1 // SPDX-License-Identifier: GPL-2.0
3 * Common header file for probe-based Dynamic events.
9 * Copyright (C) IBM Corporation, 2010-2011
32 #define MAX_TRACE_ARGS 128
33 #define MAX_ARGSTR_LEN 63
34 #define MAX_ARRAY_LEN 64
35 #define MAX_ARG_NAME_LEN 32
36 #define MAX_BTF_ARGS_LEN 128
37 #define MAX_DENTRY_ARGS_LEN 256
38 #define MAX_STRING_SIZE PATH_MAX
39 #define MAX_ARG_BUF_LEN (MAX_TRACE_ARGS * MAX_ARG_NAME_LEN)
42 #define FIELD_STRING_IP "__probe_ip"
43 #define FIELD_STRING_RETIP "__probe_ret_ip"
44 #define FIELD_STRING_FUNC "__probe_func"
47 #define DEFINE_FIELD(type, item, name, is_signed) \ argument
49 ret = trace_define_field(event_call, #type, name, \
59 #define TP_FLAG_TRACE 1
60 #define TP_FLAG_PROFILE 2
63 #define make_data_loc(len, offs) \
65 #define get_loc_len(dl) ((u32)(dl) >> 16)
66 #define get_loc_offs(dl) ((u32)(dl) & 0xffff)
78 return make_data_loc(maxlen - consumed, offset + consumed); in update_data_loc()
99 FETCH_OP_UDEREF, /* User-space Dereference: .offset */
136 #define FETCH_INSN_MAX 16
137 #define FETCH_TOKEN_COMM (-ECOMM)
141 const char *name; /* Name of type */ member
147 const char *fmttype; /* Name in format file */
150 /* For defining macros, define string/string_size types */
154 #define PRINT_TYPE_FUNC_NAME(type) print_type_##type
155 #define PRINT_TYPE_FMT_NAME(type) print_type_format_##type
158 #define DECLARE_BASIC_PRINT_TYPE_FUNC(type) \
180 #define __DEFAULT_FETCH_TYPE(t) x##t
181 #define _DEFAULT_FETCH_TYPE(t) __DEFAULT_FETCH_TYPE(t)
182 #define DEFAULT_FETCH_TYPE _DEFAULT_FETCH_TYPE(BITS_PER_LONG)
183 #define DEFAULT_FETCH_TYPE_STR __stringify(DEFAULT_FETCH_TYPE)
185 #define __ADDR_FETCH_TYPE(t) u##t
186 #define _ADDR_FETCH_TYPE(t) __ADDR_FETCH_TYPE(t)
187 #define ADDR_FETCH_TYPE _ADDR_FETCH_TYPE(BITS_PER_LONG)
189 #define __ASSIGN_FETCH_TYPE(_name, ptype, ftype, _size, sign, str, _fmttype) \
190 {.name = _name, \
200 #define _ASSIGN_FETCH_TYPE(_name, ptype, ftype, _size, sign, _fmttype) \
202 #define ASSIGN_FETCH_TYPE(ptype, ftype, sign) \
206 #define ASSIGN_FETCH_TYPE_ALIAS(ptype, atype, ftype, sign) \
209 #define ASSIGN_FETCH_TYPE_END {}
210 #define MAX_ARRAY_LEN 64
232 const char *name; /* Name of this argument */ member
276 return !!(tp->event->flags & flag); in trace_probe_test_flag()
282 tp->event->flags |= flag; in trace_probe_set_flag()
288 tp->event->flags &= ~flag; in trace_probe_clear_flag()
298 return trace_event_name(&tp->event->call); in trace_probe_name()
303 return tp->event->call.class->system; in trace_probe_group_name()
309 return &tp->event->call; in trace_probe_event_call()
323 return list_first_entry_or_null(&tpe->probes, struct trace_probe, list); in trace_probe_primary_from_call()
328 return &tp->event->probes; in trace_probe_probe_list()
340 /* tp->event is unregistered in trace_remove_event_call() */ in trace_probe_unregister_event_call()
341 return trace_remove_event_call(&tp->event->call); in trace_probe_unregister_event_call()
346 return !!list_is_singular(&tp->event->files); in trace_probe_has_single_file()
376 #define store_trace_entry_data(edata, tp, regs) do { } while (0)
379 #define trace_probe_for_each_link(pos, tp) \
380 list_for_each_entry(pos, &(tp)->event->files, list)
381 #define trace_probe_for_each_link_rcu(pos, tp) \
382 list_for_each_entry_rcu(pos, &(tp)->event->files, list)
391 #define TPARG_FL_RETURN BIT(0)
392 #define TPARG_FL_KERNEL BIT(1)
393 #define TPARG_FL_FENTRY BIT(2)
394 #define TPARG_FL_TEVENT BIT(3)
395 #define TPARG_FL_USER BIT(4)
396 #define TPARG_FL_FPROBE BIT(5)
397 #define TPARG_FL_TPOINT BIT(6)
398 #define TPARG_FL_LOC_MASK GENMASK(4, 0)
413 const char *funcname; /* Function name in BTF */
462 create_local_trace_uprobe(char *name, unsigned long offs,
470 #define ERRORS \
471 C(FILE_NOT_FOUND, "Failed to find the given file"), \
472 C(NO_REGULAR_FILE, "Not a regular file"), \
473 C(BAD_REFCNT, "Invalid reference counter offset"), \
474 C(REFCNT_OPEN_BRACE, "Reference counter brace is not closed"), \
475 C(BAD_REFCNT_SUFFIX, "Reference counter has wrong suffix"), \
476 C(BAD_UPROBE_OFFS, "Invalid uprobe offset"), \
477 C(BAD_MAXACT_TYPE, "Maxactive is only for function exit"), \
478 C(BAD_MAXACT, "Invalid maxactive number"), \
479 C(MAXACT_TOO_BIG, "Maxactive is too big"), \
480 C(BAD_PROBE_ADDR, "Invalid probed address or symbol"), \
481 C(NON_UNIQ_SYMBOL, "The symbol is not unique"), \
482 C(BAD_RETPROBE, "Retprobe address must be an function entry"), \
483 C(NO_TRACEPOINT, "Tracepoint is not found"), \
484 C(BAD_ADDR_SUFFIX, "Invalid probed address suffix"), \
485 C(NO_GROUP_NAME, "Group name is not specified"), \
486 C(GROUP_TOO_LONG, "Group name is too long"), \
487 C(BAD_GROUP_NAME, "Group name must follow the same rules as C identifiers"), \
488 C(NO_EVENT_NAME, "Event name is not specified"), \
489 C(EVENT_TOO_LONG, "Event name is too long"), \
490 C(BAD_EVENT_NAME, "Event name must follow the same rules as C identifiers"), \
491 C(EVENT_EXIST, "Given group/event name is already used by another event"), \
492 C(RETVAL_ON_PROBE, "$retval is not available on probe"), \
493 C(NO_RETVAL, "This function returns 'void' type"), \
494 C(BAD_STACK_NUM, "Invalid stack number"), \
495 C(BAD_ARG_NUM, "Invalid argument number"), \
496 C(BAD_VAR, "Invalid $-valiable specified"), \
497 C(BAD_REG_NAME, "Invalid register name"), \
498 C(BAD_MEM_ADDR, "Invalid memory address"), \
499 C(BAD_IMM, "Invalid immediate value"), \
500 C(IMMSTR_NO_CLOSE, "String is not closed with '\"'"), \
501 C(FILE_ON_KPROBE, "File offset is not available with kprobe"), \
502 C(BAD_FILE_OFFS, "Invalid file offset value"), \
503 C(SYM_ON_UPROBE, "Symbol is not available with uprobe"), \
504 C(TOO_MANY_OPS, "Dereference is too much nested"), \
505 C(DEREF_NEED_BRACE, "Dereference needs a brace"), \
506 C(BAD_DEREF_OFFS, "Invalid dereference offset"), \
507 C(DEREF_OPEN_BRACE, "Dereference brace is not closed"), \
508 C(COMM_CANT_DEREF, "$comm can not be dereferenced"), \
509 C(BAD_FETCH_ARG, "Invalid fetch argument"), \
510 C(ARRAY_NO_CLOSE, "Array is not closed"), \
511 C(BAD_ARRAY_SUFFIX, "Array has wrong suffix"), \
512 C(BAD_ARRAY_NUM, "Invalid array size"), \
513 C(ARRAY_TOO_BIG, "Array number is too big"), \
514 C(BAD_TYPE, "Unknown type is specified"), \
515 C(BAD_STRING, "String accepts only memory argument"), \
516 C(BAD_SYMSTRING, "Symbol String doesn't accept data/userdata"), \
517 C(BAD_BITFIELD, "Invalid bitfield"), \
518 C(ARG_NAME_TOO_LONG, "Argument name is too long"), \
519 C(NO_ARG_NAME, "Argument name is not specified"), \
520 C(BAD_ARG_NAME, "Argument name must follow the same rules as C identifiers"), \
521 C(USED_ARG_NAME, "This argument name is already used"), \
522 C(ARG_TOO_LONG, "Argument expression is too long"), \
523 C(NO_ARG_BODY, "No argument expression"), \
524 C(BAD_INSN_BNDRY, "Probe point is not an instruction boundary"),\
525 C(FAIL_REG_PROBE, "Failed to register probe event"),\
526 C(DIFF_PROBE_TYPE, "Probe type is different from existing probe"),\
527 C(DIFF_ARG_TYPE, "Argument type or name is different from existing probe"),\
528 C(SAME_PROBE, "There is already the exact same probe event"),\
529 C(NO_EVENT_INFO, "This requires both group and event name to attach"),\
530 C(BAD_ATTACH_EVENT, "Attached event does not exist"),\
531 C(BAD_ATTACH_ARG, "Attached event does not have this field"),\
532 C(NO_EP_FILTER, "No filter rule after 'if'"), \
533 C(NOSUP_BTFARG, "BTF is not available or not supported"), \
534 C(NO_BTFARG, "This variable is not found at this probe point"),\
535 C(NO_BTF_ENTRY, "No BTF entry for this probe point"), \
536 C(BAD_VAR_ARGS, "$arg* must be an independent parameter without name etc."),\
537 C(NOFENTRY_ARGS, "$arg* can be used only on function entry or exit"), \
538 C(DOUBLE_ARGS, "$arg* can be used only once in the parameters"), \
539 C(ARGS_2LONG, "$arg* failed because the argument list is too long"), \
540 C(ARGIDX_2BIG, "$argN index is too big"), \
541 C(NO_PTR_STRCT, "This is not a pointer to union/structure."), \
542 C(NOSUP_DAT_ARG, "Non pointer structure/union argument is not supported."),\
543 C(BAD_HYPHEN, "Failed to parse single hyphen. Forgot '>'?"), \
544 C(NO_BTF_FIELD, "This field is not found."), \
545 C(BAD_BTF_TID, "Failed to get BTF type info."),\
546 C(BAD_TYPE4STR, "This type does not fit for string."),\
547 C(NEED_STRING_TYPE, "$comm and immediate-string only accepts string type"),
549 #undef C
550 #define C(a, b) TP_ERR_##a macro
552 /* Define TP_ERR_ */
555 /* Error text is defined in trace_probe.c */
569 #define trace_probe_log_err(offs, err) \