Lines Matching refs:field
209 u64 (*integer)(struct tp_field *field, struct perf_sample *sample);
210 void *(*pointer)(struct tp_field *field, struct perf_sample *sample);
215 static u64 tp_field__u##bits(struct tp_field *field, struct perf_sample *sample) \
218 memcpy(&value, sample->raw_data + field->offset, sizeof(value)); \
228 static u64 tp_field__swapped_u##bits(struct tp_field *field, struct perf_sample *sample) \
231 memcpy(&value, sample->raw_data + field->offset, sizeof(value)); \
239 static int __tp_field__init_uint(struct tp_field *field, int size, int offset, bool needs_swap)
241 field->offset = offset;
245 field->integer = tp_field__u8;
248 field->integer = needs_swap ? tp_field__swapped_u16 : tp_field__u16;
251 field->integer = needs_swap ? tp_field__swapped_u32 : tp_field__u32;
254 field->integer = needs_swap ? tp_field__swapped_u64 : tp_field__u64;
263 static int tp_field__init_uint(struct tp_field *field, struct tep_format_field *format_field, bool needs_swap)
265 return __tp_field__init_uint(field, format_field->size, format_field->offset, needs_swap);
268 static void *tp_field__ptr(struct tp_field *field, struct perf_sample *sample)
270 return sample->raw_data + field->offset;
273 static int __tp_field__init_ptr(struct tp_field *field, int offset)
275 field->offset = offset;
276 field->pointer = tp_field__ptr;
280 static int tp_field__init_ptr(struct tp_field *field, struct tep_format_field *format_field)
282 return __tp_field__init_ptr(field, format_field->offset);
373 static int evsel__init_tp_uint_field(struct evsel *evsel, struct tp_field *field, const char *name)
380 return tp_field__init_uint(field, format_field, evsel->needs_swap);
387 static int evsel__init_tp_ptr_field(struct evsel *evsel, struct tp_field *field, const char *name)
394 return tp_field__init_ptr(field, format_field);
1732 syscall_arg_fmt__init_array(struct syscall_arg_fmt *arg, struct tep_format_field *field)
1737 for (; field; field = field->next, ++arg) {
1738 last_field = field;
1743 len = strlen(field->name);
1745 if (strcmp(field->type, "const char *") == 0 &&
1746 ((len >= 4 && strcmp(field->name + len - 4, "name") == 0) ||
1747 strstr(field->name, "path") != NULL))
1749 else if ((field->flags & TEP_FIELD_IS_POINTER) || strstr(field->name, "addr"))
1751 else if (strcmp(field->type, "pid_t") == 0)
1753 else if (strcmp(field->type, "umode_t") == 0)
1755 else if ((field->flags & TEP_FIELD_IS_ARRAY) && strstr(field->type, "char")) {
1757 arg->nr_entries = field->arraylen;
1758 } else if ((strcmp(field->type, "int") == 0 ||
1759 strcmp(field->type, "unsigned int") == 0 ||
1760 strcmp(field->type, "long") == 0) &&
1761 len >= 2 && strcmp(field->name + len - 2, "fd") == 0) {
1764 * grep -E 'field:.*fd;' .../format|sed -r 's/.*field:([a-z ]+) [a-z_]*fd.+/\1/g'|sort|uniq -c
1772 syscall_arg_fmt__find_by_name(field->name);
1861 * So drop '__syscall_nr' or 'nr' field but does not exist on older kernels.
2063 struct tep_format_field *field;
2065 for (field = sc->args; field;
2066 field = field->next, ++arg.idx, bit <<= 1) {
2095 printed += scnprintf(bf + printed, size - printed, "%s: ", field->name);
2742 struct tep_format_field *field = evsel->tp_format->format.fields;
2759 for (; field && arg; field = field->next, ++syscall_arg.idx, bit <<= 1, ++arg) {
2765 if (field->flags & TEP_FIELD_IS_ARRAY) {
2766 int offset = field->offset;
2768 if (field->flags & TEP_FIELD_IS_DYNAMIC) {
2769 offset = format_field__intval(field, sample, evsel->needs_swap);
2772 if (tep_field_is_relative(field->flags))
2773 offset += field->offset + field->size;
2778 val = format_field__intval(field, sample, evsel->needs_swap);
2801 printed += scnprintf(bf + printed, size - printed, "%s: ", field->name);
3357 struct tep_format_field *field, *candidate_field;
3363 for (field = sc->args; field; field = field->next) {
3364 if (field->flags & TEP_FIELD_IS_POINTER)
3380 for (field = sc->args, candidate_field = pair->args;
3381 field && candidate_field; field = field->next, candidate_field = candidate_field->next) {
3382 bool is_pointer = field->flags & TEP_FIELD_IS_POINTER,
3398 if (strcmp(field->type, candidate_field->type))
3406 if (strcmp(field->type, "const char *") == 0 &&
3407 !(strstr(field->name, "name") ||
3408 strstr(field->name, "path") ||
3409 strstr(field->name, "file") ||
3410 strstr(field->name, "root") ||
3411 strstr(field->name, "description")))
3686 struct tep_format_field *field;
3692 for (field = evsel->tp_format->format.fields; field; field = field->next, ++fmt)
3693 if (strcmp(field->name, arg) == 0)