Console Output
Skipping 153 KB..
Full Log1: - data_ptr = (void *)data;
1: - else
1: - data_ptr = &data;
1: -
1: - if (trace->buf_len + MAX_TRACE_DATA >= MAX_TRACE_BUF)
1: - break;
1: -
1: - buf_offset = &trace->buf[trace->buf_len];
1: - if (buf_offset > &trace->buf[MAX_TRACE_BUF]) {
1: - currdata->err_type_id = currtrace->type_id;
1: - currdata->err = -ENOSPC;
1: - continue;
1: - }
1: - currdata->buf_offset = trace->buf_len;
1: -
1: - tracesize = currtrace->size;
1: - if (tracesize > MAX_TRACE_DATA)
1: - tracesize = MAX_TRACE_DATA;
1: - ret = bpf_probe_read(buf_offset, tracesize, data_ptr);
1: - if (ret < 0) {
1: - currdata->err_type_id = currtrace->type_id;
1: - currdata->err = ret;
1: - continue;
1: - } else {
1: - currdata->buf_len = tracesize;
1: - trace->buf_len += tracesize;
1: - }
1: - }
1: -
1: - /* show accumulated stashed traces (if any) */
1: - if ((entry && trace->prev_ip && !trace->next_ip) ||
1: - (!entry && trace->next_ip && !trace->prev_ip))
1: - output_stashed_traces(ctx, trace, entry);
1: - else
1: - output_trace(ctx, trace);
1: -
1: - return 0;
1: +static int ksnoop(struct pt_regs *ctx, bool entry) {
1: + void *data_ptr = NULL;
1: + struct trace *trace;
1: + struct func *func;
1: + __u16 trace_len;
1: + __u64 data, pg;
1: + __u32 currpid;
1: + int ret;
1: + __u8 i;
1: +
1: + trace = get_trace(ctx, entry);
1: + if (!trace)
1: + return 0;
1: +
1: + func = &trace->func;
1: +
1: + /* make sure we want events from this pid */
1: + currpid = bpf_get_current_pid_tgid();
1: + if (trace->filter_pid && trace->filter_pid != currpid)
1: + return 0;
1: + trace->pid = currpid;
1: +
1: + trace->cpu = bpf_get_smp_processor_id();
1: + trace->time = bpf_ktime_get_ns();
1: +
1: + trace->data_flags &= ~(KSNOOP_F_ENTRY | KSNOOP_F_RETURN);
1: + if (entry)
1: + trace->data_flags |= KSNOOP_F_ENTRY;
1: + else
1: + trace->data_flags |= KSNOOP_F_RETURN;
1: +
1: + for (i = 0; i < MAX_TRACES; i++) {
1: + struct trace_data *currdata;
1: + struct value *currtrace;
1: + char *buf_offset = NULL;
1: + __u32 tracesize;
1: +
1: + currdata = &trace->trace_data[i];
1: + currtrace = &trace->traces[i];
1: +
1: + if ((entry && !base_arg_is_entry(currtrace->base_arg)) ||
1: + (!entry && base_arg_is_entry(currtrace->base_arg)))
1: + continue;
1: +
1: + /* skip void (unused) trace arguments, ensuring not to
1: + * skip "void *".
1: + */
1: + if (currtrace->type_id == 0 && !(currtrace->flags & KSNOOP_F_PTR))
1: + continue;
1: +
1: + data = get_arg(ctx, currtrace->base_arg);
1: +
1: + /* look up member value and read into data field. */
1: + if (currtrace->flags & KSNOOP_F_MEMBER) {
1: + if (currtrace->offset)
1: + data += currtrace->offset;
1: +
1: + /* member is a pointer; read it in */
1: + if (currtrace->flags & KSNOOP_F_PTR) {
1: + void *dataptr = (void *)data;
1: +
1: + ret = bpf_probe_read(&data, sizeof(data), dataptr);
1: + if (ret) {
1: + currdata->err_type_id = currtrace->type_id;
1: + currdata->err = ret;
1: + continue;
1: + }
1: + currdata->raw_value = data;
1: + } else if (currtrace->size <= sizeof(currdata->raw_value)) {
1: + /* read member value for predicate comparison */
1: + bpf_probe_read(&currdata->raw_value, currtrace->size, (void *)data);
1: + }
1: + } else {
1: + currdata->raw_value = data;
1: + }
1: +
1: + /* simple predicate evaluation: if any predicate fails,
1: + * skip all tracing for this function.
1: + */
1: + if (currtrace->flags & KSNOOP_F_PREDICATE_MASK) {
1: + bool ok = false;
1: +
1: + if (currtrace->flags & KSNOOP_F_PREDICATE_EQ &&
1: + currdata->raw_value == currtrace->predicate_value)
1: + ok = true;
1: +
1: + if (currtrace->flags & KSNOOP_F_PREDICATE_NOTEQ &&
1: + currdata->raw_value != currtrace->predicate_value)
1: + ok = true;
1: +
1: + if (currtrace->flags & KSNOOP_F_PREDICATE_GT &&
1: + currdata->raw_value > currtrace->predicate_value)
1: + ok = true;
1: +
1: + if (currtrace->flags & KSNOOP_F_PREDICATE_LT &&
1: + currdata->raw_value < currtrace->predicate_value)
1: + ok = true;
1: +
1: + if (!ok) {
1: + clear_trace(trace);
1: + return 0;
1: + }
1: + }
1: +
1: + if (currtrace->flags & (KSNOOP_F_PTR | KSNOOP_F_MEMBER))
1: + data_ptr = (void *)data;
1: + else
1: + data_ptr = &data;
1: +
1: + if (trace->buf_len + MAX_TRACE_DATA >= MAX_TRACE_BUF)
1: + break;
1: +
1: + buf_offset = &trace->buf[trace->buf_len];
1: + if (buf_offset > &trace->buf[MAX_TRACE_BUF]) {
1: + currdata->err_type_id = currtrace->type_id;
1: + currdata->err = -ENOSPC;
1: + continue;
1: + }
1: + currdata->buf_offset = trace->buf_len;
1: +
1: + tracesize = currtrace->size;
1: + if (tracesize > MAX_TRACE_DATA)
1: + tracesize = MAX_TRACE_DATA;
1: + ret = bpf_probe_read(buf_offset, tracesize, data_ptr);
1: + if (ret < 0) {
1: + currdata->err_type_id = currtrace->type_id;
1: + currdata->err = ret;
1: + continue;
1: + } else {
1: + currdata->buf_len = tracesize;
1: + trace->buf_len += tracesize;
1: + }
1: + }
1: +
1: + /* show accumulated stashed traces (if any) */
1: + if ((entry && trace->prev_ip && !trace->next_ip) ||
1: + (!entry && trace->next_ip && !trace->prev_ip))
1: + output_stashed_traces(ctx, trace, entry);
1: + else
1: + output_trace(ctx, trace);
1: +
1: + return 0;
1: }
1:
1: SEC("kprobe/foo")
1: -int kprobe_entry(struct pt_regs *ctx)
1: -{
1: - return ksnoop(ctx, true);
1: -}
1: +int kprobe_entry(struct pt_regs *ctx) { return ksnoop(ctx, true); }
1:
1: SEC("kretprobe/foo")
1: -int kprobe_return(struct pt_regs *ctx)
1: -{
1: - return ksnoop(ctx, false);
1: -}
1: +int kprobe_return(struct pt_regs *ctx) { return ksnoop(ctx, false); }
1:
1: char _license[] SEC("license") = "Dual BSD/GPL";
1: diff --git a/libbpf-tools/ksnoop.c b/libbpf-tools/ksnoop.c
1: index f6d4d8e4..0435472e 100644
1: --- a/libbpf-tools/ksnoop.c
1: +++ b/libbpf-tools/ksnoop.c
1: @@ -10,14 +10,14 @@
1: #include <string.h>
1:
1: #include <bpf/bpf.h>
1: -#include <bpf/libbpf.h>
1: #include <bpf/btf.h>
1: +#include <bpf/libbpf.h>
1:
1: #include "ksnoop.h"
1: #include "ksnoop.skel.h"
1:
1: #ifndef KSNOOP_VERSION
1: -#define KSNOOP_VERSION "0.1"
1: +#define KSNOOP_VERSION "0.1"
1: #endif
1:
1: static struct btf *vmlinux_btf;
1: @@ -25,9 +25,9 @@ static const char *bin_name;
1: static int pages = PAGES_DEFAULT;
1:
1: enum log_level {
1: - DEBUG,
1: - WARN,
1: - ERROR,
1: + DEBUG,
1: + WARN,
1: + ERROR,
1: };
1:
1: static enum log_level log_level = WARN;
1: @@ -35,946 +35,871 @@ static enum log_level log_level = WARN;
1: static __u32 filter_pid;
1: static bool stack_mode;
1:
1: -#define libbpf_errstr(val) strerror(-libbpf_get_error(val))
1: +#define libbpf_errstr(val) strerror(-libbpf_get_error(val))
1:
1: -static void __p(enum log_level level, char *level_str, char *fmt, ...)
1: -{
1: - va_list ap;
1: +static void __p(enum log_level level, char *level_str, char *fmt, ...) {
1: + va_list ap;
1:
1: - if (level < log_level)
1: - return;
1: - va_start(ap, fmt);
1: - fprintf(stderr, "%s: ", level_str);
1: - vfprintf(stderr, fmt, ap);
1: - fprintf(stderr, "\n");
1: - va_end(ap);
1: - fflush(stderr);
1: + if (level < log_level)
1: + return;
1: + va_start(ap, fmt);
1: + fprintf(stderr, "%s: ", level_str);
1: + vfprintf(stderr, fmt, ap);
1: + fprintf(stderr, "\n");
1: + va_end(ap);
1: + fflush(stderr);
1: }
1:
1: -#define p_err(fmt, ...) __p(ERROR, "Error", fmt, ##__VA_ARGS__)
1: -#define p_warn(fmt, ...) __p(WARNING, "Warn", fmt, ##__VA_ARGS__)
1: -#define p_debug(fmt, ...) __p(DEBUG, "Debug", fmt, ##__VA_ARGS__)
1: +#define p_err(fmt, ...) __p(ERROR, "Error", fmt, ##__VA_ARGS__)
1: +#define p_warn(fmt, ...) __p(WARNING, "Warn", fmt, ##__VA_ARGS__)
1: +#define p_debug(fmt, ...) __p(DEBUG, "Debug", fmt, ##__VA_ARGS__)
1:
1: -static int do_version(int argc, char **argv)
1: -{
1: - printf("%s v%s\n", bin_name, KSNOOP_VERSION);
1: - return 0;
1: +static int do_version(int argc, char **argv) {
1: + printf("%s v%s\n", bin_name, KSNOOP_VERSION);
1: + return 0;
1: }
1:
1: -static int cmd_help(int argc, char **argv)
1: -{
1: - fprintf(stderr,
1: - "Usage: %s [OPTIONS] [COMMAND | help] FUNC\n"
1: - " COMMAND := { trace | info }\n"
1: - " FUNC := { name | name(ARG[,ARG]*) }\n"
1: - " ARG := { arg | arg [PRED] | arg->member [PRED] }\n"
1: - " PRED := { == | != | > | >= | < | <= value }\n"
1: - " OPTIONS := { {-d|--debug} | {-V|--version} |\n"
1: - " {-p|--pid filter_pid}|\n"
1: - " {-P|--pages nr_pages} }\n"
1: - " {-s|--stack}\n",
1: - bin_name);
1: - fprintf(stderr,
1: - "Examples:\n"
1: - " %s info ip_send_skb\n"
1: - " %s trace ip_send_skb\n"
1: - " %s trace \"ip_send_skb(skb, return)\"\n"
1: - " %s trace \"ip_send_skb(skb->sk, return)\"\n"
1: - " %s trace \"ip_send_skb(skb->len > 128, skb)\"\n"
1: - " %s trace -s udp_sendmsg ip_send_skb\n",
1: - bin_name, bin_name, bin_name, bin_name, bin_name, bin_name);
1: - return 0;
1: +static int cmd_help(int argc, char **argv) {
1: + fprintf(stderr,
1: + "Usage: %s [OPTIONS] [COMMAND | help] FUNC\n"
1: + " COMMAND := { trace | info }\n"
1: + " FUNC := { name | name(ARG[,ARG]*) }\n"
1: + " ARG := { arg | arg [PRED] | arg->member [PRED] }\n"
1: + " PRED := { == | != | > | >= | < | <= value }\n"
1: + " OPTIONS := { {-d|--debug} | {-V|--version} |\n"
1: + " {-p|--pid filter_pid}|\n"
1: + " {-P|--pages nr_pages} }\n"
1: + " {-s|--stack}\n",
1: + bin_name);
1: + fprintf(stderr,
1: + "Examples:\n"
1: + " %s info ip_send_skb\n"
1: + " %s trace ip_send_skb\n"
1: + " %s trace \"ip_send_skb(skb, return)\"\n"
1: + " %s trace \"ip_send_skb(skb->sk, return)\"\n"
1: + " %s trace \"ip_send_skb(skb->len > 128, skb)\"\n"
1: + " %s trace -s udp_sendmsg ip_send_skb\n",
1: + bin_name, bin_name, bin_name, bin_name, bin_name, bin_name);
1: + return 0;
1: }
1:
1: -static void usage(void)
1: -{
1: - cmd_help(0, NULL);
1: - exit(1);
1: +static void usage(void) {
1: + cmd_help(0, NULL);
1: + exit(1);
1: }
1:
1: static void type_to_value(struct btf *btf, char *name, __u32 type_id,
1: - struct value *val)
1: -{
1: - const struct btf_type *type;
1: - __s32 id = type_id;
1: -
1: - if (strlen(val->name) == 0) {
1: - if (name)
1: - strncpy(val->name, name,
1: - sizeof(val->name) - 1);
1: - else
1: - val->name[0] = '\0';
1: - }
1: - do {
1: - type = btf__type_by_id(btf, id);
1: -
1: - switch (BTF_INFO_KIND(type->info)) {
1: - case BTF_KIND_CONST:
1: - case BTF_KIND_VOLATILE:
1: - case BTF_KIND_RESTRICT:
1: - id = type->type;
1: - break;
1: - case BTF_KIND_PTR:
1: - val->flags |= KSNOOP_F_PTR;
1: - id = type->type;
1: - break;
1: - default:
1: - val->type_id = id;
1: - goto done;
1: - }
1: - } while (id >= 0);
1: -
1: - val->type_id = KSNOOP_ID_UNKNOWN;
1: - return;
1: + struct value *val) {
1: + const struct btf_type *type;
1: + __s32 id = type_id;
1: +
1: + if (strlen(val->name) == 0) {
1: + if (name)
1: + strncpy(val->name, name, sizeof(val->name) - 1);
1: + else
1: + val->name[0] = '\0';
1: + }
1: + do {
1: + type = btf__type_by_id(btf, id);
1: +
1: + switch (BTF_INFO_KIND(type->info)) {
1: + case BTF_KIND_CONST:
1: + case BTF_KIND_VOLATILE:
1: + case BTF_KIND_RESTRICT:
1: + id = type->type;
1: + break;
1: + case BTF_KIND_PTR:
1: + val->flags |= KSNOOP_F_PTR;
1: + id = type->type;
1: + break;
1: + default:
1: + val->type_id = id;
1: + goto done;
1: + }
1: + } while (id >= 0);
1: +
1: + val->type_id = KSNOOP_ID_UNKNOWN;
1: + return;
1: done:
1: - val->size = btf__resolve_size(btf, val->type_id);
1: + val->size = btf__resolve_size(btf, val->type_id);
1: }
1:
1: static int member_to_value(struct btf *btf, const char *name, __u32 type_id,
1: - struct value *val, int lvl)
1: -{
1: - const struct btf_member *member;
1: - const struct btf_type *type;
1: - const char *pname;
1: - __s32 id = type_id;
1: - int i, nmembers;
1: - __u8 kind;
1: -
1: - /* type_to_value has already stripped qualifiers, so
1: - * we either have a base type, a struct, union, etc.
1: - * Only struct/unions have named members so anything
1: - * else is invalid.
1: - */
1: - p_debug("Looking for member '%s' in type id %d", name, type_id);
1: - type = btf__type_by_id(btf, id);
1: - pname = btf__str_by_offset(btf, type->name_off);
1: - if (strlen(pname) == 0)
1: - pname = "<anon>";
1: -
1: - kind = BTF_INFO_KIND(type->info);
1: - switch (kind) {
1: - case BTF_KIND_STRUCT:
1: - case BTF_KIND_UNION:
1: - nmembers = BTF_INFO_VLEN(type->info);
1: - p_debug("Checking %d members...", nmembers);
1: - for (member = (struct btf_member *)(type + 1), i = 0;
1: - i < nmembers;
1: - member++, i++) {
1: - const char *mname;
1: - __u16 offset;
1: -
1: - type = btf__type_by_id(btf, member->type);
1: - mname = btf__str_by_offset(btf, member->name_off);
1: - offset = member->offset / 8;
1: -
1: - p_debug("Checking member '%s' type %d offset %d",
1: - mname, member->type, offset);
1: -
1: - /* anonymous struct member? */
1: - kind = BTF_INFO_KIND(type->info);
1: - if (strlen(mname) == 0 &&
1: - (kind == BTF_KIND_STRUCT ||
1: - kind == BTF_KIND_UNION)) {
1: - p_debug("Checking anon struct/union %d",
1: - member->type);
1: - val->offset += offset;
1: - if (!member_to_value(btf, name, member->type,
1: - val, lvl + 1))
1: - return 0;
1: - val->offset -= offset;
1: - continue;
1: - }
1: -
1: - if (strcmp(mname, name) == 0) {
1: - val->offset += offset;
1: - val->flags |= KSNOOP_F_MEMBER;
1: - type_to_value(btf, NULL, member->type, val);
1: - p_debug("Member '%s', offset %d, flags %x size %d",
1: - mname, val->offset, val->flags,
1: - val->size);
1: - return 0;
1: - }
1: - }
1: - if (lvl > 0)
1: - break;
1: - p_err("No member '%s' found in %s [%d], offset %d", name, pname,
1: - id, val->offset);
1: - break;
1: - default:
1: - p_err("'%s' is not a struct/union", pname);
1: - break;
1: - }
1: - return -ENOENT;
1: + struct value *val, int lvl) {
1: + const struct btf_member *member;
1: + const struct btf_type *type;
1: + const char *pname;
1: + __s32 id = type_id;
1: + int i, nmembers;
1: + __u8 kind;
1: +
1: + /* type_to_value has already stripped qualifiers, so
1: + * we either have a base type, a struct, union, etc.
1: + * Only struct/unions have named members so anything
1: + * else is invalid.
1: + */
1: + p_debug("Looking for member '%s' in type id %d", name, type_id);
1: + type = btf__type_by_id(btf, id);
1: + pname = btf__str_by_offset(btf, type->name_off);
1: + if (strlen(pname) == 0)
1: + pname = "<anon>";
1: +
1: + kind = BTF_INFO_KIND(type->info);
1: + switch (kind) {
1: + case BTF_KIND_STRUCT:
1: + case BTF_KIND_UNION:
1: + nmembers = BTF_INFO_VLEN(type->info);
1: + p_debug("Checking %d members...", nmembers);
1: + for (member = (struct btf_member *)(type + 1), i = 0; i < nmembers;
1: + member++, i++) {
1: + const char *mname;
1: + __u16 offset;
1: +
1: + type = btf__type_by_id(btf, member->type);
1: + mname = btf__str_by_offset(btf, member->name_off);
1: + offset = member->offset / 8;
1: +
1: + p_debug("Checking member '%s' type %d offset %d", mname, member->type,
1: + offset);
1: +
1: + /* anonymous struct member? */
1: + kind = BTF_INFO_KIND(type->info);
1: + if (strlen(mname) == 0 &&
1: + (kind == BTF_KIND_STRUCT || kind == BTF_KIND_UNION)) {
1: + p_debug("Checking anon struct/union %d", member->type);
1: + val->offset += offset;
1: + if (!member_to_value(btf, name, member->type, val, lvl + 1))
1: + return 0;
1: + val->offset -= offset;
1: + continue;
1: + }
1: +
1: + if (strcmp(mname, name) == 0) {
1: + val->offset += offset;
1: + val->flags |= KSNOOP_F_MEMBER;
1: + type_to_value(btf, NULL, member->type, val);
1: + p_debug("Member '%s', offset %d, flags %x size %d", mname, val->offset,
1: + val->flags, val->size);
1: + return 0;
1: + }
1: + }
1: + if (lvl > 0)
1: + break;
1: + p_err("No member '%s' found in %s [%d], offset %d", name, pname, id,
1: + val->offset);
1: + break;
1: + default:
1: + p_err("'%s' is not a struct/union", pname);
1: + break;
1: + }
1: + return -ENOENT;
1: }
1:
1: -static int get_func_btf(struct btf *btf, struct func *func)
1: -{
1: - const struct btf_param *param;
1: - const struct btf_type *type;
1: - __u8 i;
1: -
1: - func->id = btf__find_by_name_kind(btf, func->name, BTF_KIND_FUNC);
1: - if (func->id <= 0) {
1: - p_err("Cannot find function '%s' in BTF: %s",
1: - func->name, strerror(-func->id));
1: - return -ENOENT;
1: - }
1: - type = btf__type_by_id(btf, func->id);
1: - if (libbpf_get_error(type) ||
1: - BTF_INFO_KIND(type->info) != BTF_KIND_FUNC) {
1: - p_err("Error looking up function type via id '%d'", func->id);
1: - return -EINVAL;
1: - }
1: - type = btf__type_by_id(btf, type->type);
1: - if (libbpf_get_error(type) ||
1: - BTF_INFO_KIND(type->info) != BTF_KIND_FUNC_PROTO) {
1: - p_err("Error looking up function proto type via id '%d'",
1: - func->id);
1: - return -EINVAL;
1: - }
1: - for (param = (struct btf_param *)(type + 1), i = 0;
1: - i < BTF_INFO_VLEN(type->info) && i < MAX_ARGS;
1: - param++, i++) {
1: - type_to_value(btf,
1: - (char *)btf__str_by_offset(btf, param->name_off),
1: - param->type, &func->args[i]);
1: - p_debug("arg #%d: <name '%s', type id '%u'>",
1: - i + 1, func->args[i].name, func->args[i].type_id);
1: - }
1: -
1: - /* real number of args, even if it is > number we recorded. */
1: - func->nr_args = BTF_INFO_VLEN(type->info);
1: -
1: - type_to_value(btf, KSNOOP_RETURN_NAME, type->type,
1: - &func->args[KSNOOP_RETURN]);
1: - p_debug("return value: type id '%u'>",
1: - func->args[KSNOOP_RETURN].type_id);
1: - return 0;
1: +static int get_func_btf(struct btf *btf, struct func *func) {
1: + const struct btf_param *param;
1: + const struct btf_type *type;
1: + __u8 i;
1: +
1: + func->id = btf__find_by_name_kind(btf, func->name, BTF_KIND_FUNC);
1: + if (func->id <= 0) {
1: + p_err("Cannot find function '%s' in BTF: %s", func->name,
1: + strerror(-func->id));
1: + return -ENOENT;
1: + }
1: + type = btf__type_by_id(btf, func->id);
1: + if (libbpf_get_error(type) || BTF_INFO_KIND(type->info) != BTF_KIND_FUNC) {
1: + p_err("Error looking up function type via id '%d'", func->id);
1: + return -EINVAL;
1: + }
1: + type = btf__type_by_id(btf, type->type);
1: + if (libbpf_get_error(type) ||
1: + BTF_INFO_KIND(type->info) != BTF_KIND_FUNC_PROTO) {
1: + p_err("Error looking up function proto type via id '%d'", func->id);
1: + return -EINVAL;
1: + }
1: + for (param = (struct btf_param *)(type + 1), i = 0;
1: + i < BTF_INFO_VLEN(type->info) && i < MAX_ARGS; param++, i++) {
1: + type_to_value(btf, (char *)btf__str_by_offset(btf, param->name_off),
1: + param->type, &func->args[i]);
1: + p_debug("arg #%d: <name '%s', type id '%u'>", i + 1, func->args[i].name,
1: + func->args[i].type_id);
1: + }
1: +
1: + /* real number of args, even if it is > number we recorded. */
1: + func->nr_args = BTF_INFO_VLEN(type->info);
1: +
1: + type_to_value(btf, KSNOOP_RETURN_NAME, type->type,
1: + &func->args[KSNOOP_RETURN]);
1: + p_debug("return value: type id '%u'>", func->args[KSNOOP_RETURN].type_id);
1: + return 0;
1: }
1:
1: -int predicate_to_value(char *predicate, struct value *val)
1: -{
1: - char pred[MAX_STR];
1: - long v;
1: -
1: - if (!predicate)
1: - return 0;
1: -
1: - p_debug("checking predicate '%s' for '%s'", predicate, val->name);
1: -
1: - if (sscanf(predicate, "%[!=><]%li", pred, &v) != 2) {
1: - p_err("Invalid specification; expected predicate, not '%s'",
1: - predicate);
1: - return -EINVAL;
1: - }
1: - if (!(val->flags & KSNOOP_F_PTR) &&
1: - (val->size == 0 || val->size > sizeof(__u64))) {
1: - p_err("'%s' (size %d) does not support predicate comparison",
1: - val->name, val->size);
1: - return -EINVAL;
1: - }
1: - val->predicate_value = (__u64)v;
1: -
1: - if (strcmp(pred, "==") == 0) {
1: - val->flags |= KSNOOP_F_PREDICATE_EQ;
1: - goto out;
1: - } else if (strcmp(pred, "!=") == 0) {
1: - val->flags |= KSNOOP_F_PREDICATE_NOTEQ;
1: - goto out;
1: - }
1: - if (pred[0] == '>')
1: - val->flags |= KSNOOP_F_PREDICATE_GT;
1: - else if (pred[0] == '<')
1: - val->flags |= KSNOOP_F_PREDICATE_LT;
1: -
1: - if (strlen(pred) == 1)
1: - goto out;
1: -
1: - if (pred[1] != '=') {
1: - p_err("Invalid predicate specification '%s'", predicate);
1: - return -EINVAL;
1: - }
1: - val->flags |= KSNOOP_F_PREDICATE_EQ;
1: +int predicate_to_value(char *predicate, struct value *val) {
1: + char pred[MAX_STR];
1: + long v;
1: +
1: + if (!predicate)
1: + return 0;
1: +
1: + p_debug("checking predicate '%s' for '%s'", predicate, val->name);
1: +
1: + if (sscanf(predicate, "%[!=><]%li", pred, &v) != 2) {
1: + p_err("Invalid specification; expected predicate, not '%s'", predicate);
1: + return -EINVAL;
1: + }
1: + if (!(val->flags & KSNOOP_F_PTR) &&
1: + (val->size == 0 || val->size > sizeof(__u64))) {
1: + p_err("'%s' (size %d) does not support predicate comparison", val->name,
1: + val->size);
1: + return -EINVAL;
1: + }
1: + val->predicate_value = (__u64)v;
1: +
1: + if (strcmp(pred, "==") == 0) {
1: + val->flags |= KSNOOP_F_PREDICATE_EQ;
1: + goto out;
1: + } else if (strcmp(pred, "!=") == 0) {
1: + val->flags |= KSNOOP_F_PREDICATE_NOTEQ;
1: + goto out;
1: + }
1: + if (pred[0] == '>')
1: + val->flags |= KSNOOP_F_PREDICATE_GT;
1: + else if (pred[0] == '<')
1: + val->flags |= KSNOOP_F_PREDICATE_LT;
1: +
1: + if (strlen(pred) == 1)
1: + goto out;
1: +
1: + if (pred[1] != '=') {
1: + p_err("Invalid predicate specification '%s'", predicate);
1: + return -EINVAL;
1: + }
1: + val->flags |= KSNOOP_F_PREDICATE_EQ;
1:
1: out:
1: - p_debug("predicate '%s', flags 0x%x value %x",
1: - pred, val->flags, val->predicate_value);
1: + p_debug("predicate '%s', flags 0x%x value %x", pred, val->flags,
1: + val->predicate_value);
1:
1: - return 0;
1: + return 0;
1: }
1:
1: static int trace_to_value(struct btf *btf, struct func *func, char *argname,
1: - char *membername, char *predicate, struct value *val)
1: -{
1: - __u8 i;
1: -
1: - if (strlen(membername) > 0)
1: - snprintf(val->name, sizeof(val->name), "%s->%s",
1: - argname, membername);
1: - else
1: - strncpy(val->name, argname, sizeof(val->name));
1: -
1: - for (i = 0; i < MAX_TRACES; i++) {
1: - if (!func->args[i].name)
1: - continue;
1: - if (strcmp(argname, func->args[i].name) != 0)
1: - continue;
1: - p_debug("setting base arg for val %s to %d", val->name, i);
1: - val->base_arg = i;
1: -
1: - if (strlen(membername) > 0) {
1: - if (member_to_value(btf, membername,
1: - func->args[i].type_id, val, 0))
1: - return -ENOENT;
1: - } else {
1: - val->type_id = func->args[i].type_id;
1: - val->flags |= func->args[i].flags;
1: - val->size = func->args[i].size;
1: - }
1: - return predicate_to_value(predicate, val);
1: - }
1: - p_err("Could not find '%s' in arguments/return value for '%s'",
1: - argname, func->name);
1: - return -ENOENT;
1: + char *membername, char *predicate,
1: + struct value *val) {
1: + __u8 i;
1: +
1: + if (strlen(membername) > 0)
1: + snprintf(val->name, sizeof(val->name), "%s->%s", argname, membername);
1: + else
1: + strncpy(val->name, argname, sizeof(val->name));
1: +
1: + for (i = 0; i < MAX_TRACES; i++) {
1: + if (!func->args[i].name)
1: + continue;
1: + if (strcmp(argname, func->args[i].name) != 0)
1: + continue;
1: + p_debug("setting base arg for val %s to %d", val->name, i);
1: + val->base_arg = i;
1: +
1: + if (strlen(membername) > 0) {
1: + if (member_to_value(btf, membername, func->args[i].type_id, val, 0))
1: + return -ENOENT;
1: + } else {
1: + val->type_id = func->args[i].type_id;
1: + val->flags |= func->args[i].flags;
1: + val->size = func->args[i].size;
1: + }
1: + return predicate_to_value(predicate, val);
1: + }
1: + p_err("Could not find '%s' in arguments/return value for '%s'", argname,
1: + func->name);
1: + return -ENOENT;
1: }
1:
1: -static struct btf *get_btf(const char *name)
1: -{
1: - struct btf *mod_btf;
1: -
1: - p_debug("getting BTF for %s",
1: - name && strlen(name) > 0 ? name : "vmlinux");
1: -
1: - if (!vmlinux_btf) {
1: - vmlinux_btf = btf__load_vmlinux_btf();
1: - if (libbpf_get_error(vmlinux_btf)) {
1: - p_err("No BTF, cannot determine type info: %s",
1: - libbpf_errstr(vmlinux_btf));
1: - return NULL;
1: - }
1: - }
1: - if (!name || strlen(name) == 0)
1: - return vmlinux_btf;
1: -
1: - mod_btf = btf__load_module_btf(name, vmlinux_btf);
1: - if (libbpf_get_error(mod_btf)) {
1: - p_err("No BTF for module '%s': %s",
1: - name, libbpf_errstr(mod_btf));
1: - return NULL;
1: - }
1: - return mod_btf;
1: +static struct btf *get_btf(const char *name) {
1: + struct btf *mod_btf;
1: +
1: + p_debug("getting BTF for %s", name && strlen(name) > 0 ? name : "vmlinux");
1: +
1: + if (!vmlinux_btf) {
1: + vmlinux_btf = btf__load_vmlinux_btf();
1: + if (libbpf_get_error(vmlinux_btf)) {
1: + p_err("No BTF, cannot determine type info: %s",
1: + libbpf_errstr(vmlinux_btf));
1: + return NULL;
1: + }
1: + }
1: + if (!name || strlen(name) == 0)
1: + return vmlinux_btf;
1: +
1: + mod_btf = btf__load_module_btf(name, vmlinux_btf);
1: + if (libbpf_get_error(mod_btf)) {
1: + p_err("No BTF for module '%s': %s", name, libbpf_errstr(mod_btf));
1: + return NULL;
1: + }
1: + return mod_btf;
1: }
1:
1: -static void copy_without_spaces(char *target, char *src)
1: -{
1: - for (; *src != '\0'; src++)
1: - if (!isspace(*src))
1: - *(target++) = *src;
1: - *target = '\0';
1: +static void copy_without_spaces(char *target, char *src) {
1: + for (; *src != '\0'; src++)
1: + if (!isspace(*src))
1: + *(target++) = *src;
1: + *target = '\0';
1: }
1:
1: -static char *type_id_to_str(struct btf *btf, __s32 type_id, char *str)
1: -{
1: - const struct btf_type *type;
1: - const char *name = "";
1: - char *prefix = "";
1: - char *suffix = " ";
1: - char *ptr = "";
1: -
1: - str[0] = '\0';
1: -
1: - switch (type_id) {
1: - case 0:
1: - name = "void";
1: - break;
1: - case KSNOOP_ID_UNKNOWN:
1: - name = "?";
1: - break;
1: - default:
1: - do {
1: - type = btf__type_by_id(btf, type_id);
1: -
1: - if (libbpf_get_error(type)) {
1: - name = "?";
1: - break;
1: - }
1: - switch (BTF_INFO_KIND(type->info)) {
1: - case BTF_KIND_CONST:
1: - case BTF_KIND_VOLATILE:
1: - case BTF_KIND_RESTRICT:
1: - type_id = type->type;
1: - break;
1: - case BTF_KIND_PTR:
1: - ptr = "* ";
1: - type_id = type->type;
1: - break;
1: - case BTF_KIND_ARRAY:
1: - suffix = "[]";
1: - type_id = type->type;
1: - break;
1: - case BTF_KIND_STRUCT:
1: - prefix = "struct ";
1: - name = btf__str_by_offset(btf, type->name_off);
1: - break;
1: - case BTF_KIND_UNION:
1: - prefix = "union";
1: - name = btf__str_by_offset(btf, type->name_off);
1: - break;
1: - case BTF_KIND_ENUM:
1: - prefix = "enum ";
1: - break;
1: - case BTF_KIND_TYPEDEF:
1: - name = btf__str_by_offset(btf, type->name_off);
1: - break;
1: - default:
1: - name = btf__str_by_offset(btf, type->name_off);
1: - break;
1: - }
1: - } while (type_id >= 0 && strlen(name) == 0);
1: - break;
1: - }
1: - snprintf(str, MAX_STR, "%s%s%s%s", prefix, name, suffix, ptr);
1: -
1: - return str;
1: +static char *type_id_to_str(struct btf *btf, __s32 type_id, char *str) {
1: + const struct btf_type *type;
1: + const char *name = "";
1: + char *prefix = "";
1: + char *suffix = " ";
1: + char *ptr = "";
1: +
1: + str[0] = '\0';
1: +
1: + switch (type_id) {
1: + case 0:
1: + name = "void";
1: + break;
1: + case KSNOOP_ID_UNKNOWN:
1: + name = "?";
1: + break;
1: + default:
1: + do {
1: + type = btf__type_by_id(btf, type_id);
1: +
1: + if (libbpf_get_error(type)) {
1: + name = "?";
1: + break;
1: + }
1: + switch (BTF_INFO_KIND(type->info)) {
1: + case BTF_KIND_CONST:
1: + case BTF_KIND_VOLATILE:
1: + case BTF_KIND_RESTRICT:
1: + type_id = type->type;
1: + break;
1: + case BTF_KIND_PTR:
1: + ptr = "* ";
1: + type_id = type->type;
1: + break;
1: + case BTF_KIND_ARRAY:
1: + suffix = "[]";
1: + type_id = type->type;
1: + break;
1: + case BTF_KIND_STRUCT:
1: + prefix = "struct ";
1: + name = btf__str_by_offset(btf, type->name_off);
1: + break;
1: + case BTF_KIND_UNION:
1: + prefix = "union";
1: + name = btf__str_by_offset(btf, type->name_off);
1: + break;
1: + case BTF_KIND_ENUM:
1: + prefix = "enum ";
1: + break;
1: + case BTF_KIND_TYPEDEF:
1: + name = btf__str_by_offset(btf, type->name_off);
1: + break;
1: + default:
1: + name = btf__str_by_offset(btf, type->name_off);
1: + break;
1: + }
1: + } while (type_id >= 0 && strlen(name) == 0);
1: + break;
1: + }
1: + snprintf(str, MAX_STR, "%s%s%s%s", prefix, name, suffix, ptr);
1: +
1: + return str;
1: }
1:
1: -static char *value_to_str(struct btf *btf, struct value *val, char *str)
1: -{
1: +static char *value_to_str(struct btf *btf, struct value *val, char *str) {
1: + str = type_id_to_str(btf, val->type_id, str);
1: + if (val->flags & KSNOOP_F_PTR)
1: + strncat(str, " * ", MAX_STR);
1: + if (strlen(val->name) > 0 && strcmp(val->name, KSNOOP_RETURN_NAME) != 0)
1: + strncat(str, val->name, MAX_STR);
1:
1: - str = type_id_to_str(btf, val->type_id, str);
1: - if (val->flags & KSNOOP_F_PTR)
1: - strncat(str, " * ", MAX_STR);
1: - if (strlen(val->name) > 0 &&
1: - strcmp(val->name, KSNOOP_RETURN_NAME) != 0)
1: - strncat(str, val->name, MAX_STR);
1: -
1: - return str;
1: + return str;
1: }
1:
1: /* based heavily on bpf_object__read_kallsyms_file() in libbpf.c */
1: -static int get_func_ip_mod(struct func *func)
1: -{
1: - char sym_type, sym_name[MAX_STR], mod_info[MAX_STR];
1: - unsigned long long sym_addr;
1: - int ret, err = 0;
1: - FILE *f;
1: -
1: - f = fopen("/proc/kallsyms", "r");
1: - if (!f) {
1: - err = errno;
1: - p_err("failed to open /proc/kallsyms: %d", strerror(err));
1: - return err;
1: - }
1: -
1: - while (true) {
1: - ret = fscanf(f, "%llx %c %128s%[^\n]\n",
1: - &sym_addr, &sym_type, sym_name, mod_info);
1: - if (ret == EOF && feof(f))
1: - break;
1: - if (ret < 3) {
1: - p_err("failed to read kallsyms entry: %d", ret);
1: - err = -EINVAL;
1: - goto out;
1: - }
1: - if (strcmp(func->name, sym_name) != 0)
1: - continue;
1: - func->ip = sym_addr;
1: - func->mod[0] = '\0';
1: - /* get module name from [modname] */
1: - if (ret == 4) {
1: - if (sscanf(mod_info, "%*[\t ][%[^]]", func->mod) < 1) {
1: - p_err("failed to read module name");
1: - err = -EINVAL;
1: - goto out;
1: - }
1: - }
1: - p_debug("%s = <ip %llx, mod %s>", func->name, func->ip,
1: - strlen(func->mod) > 0 ? func->mod : "vmlinux");
1: - break;
1: - }
1: +static int get_func_ip_mod(struct func *func) {
1: + char sym_type, sym_name[MAX_STR], mod_info[MAX_STR];
1: + unsigned long long sym_addr;
1: + int ret, err = 0;
1: + FILE *f;
1: +
1: + f = fopen("/proc/kallsyms", "r");
1: + if (!f) {
1: + err = errno;
1: + p_err("failed to open /proc/kallsyms: %d", strerror(err));
1: + return err;
1: + }
1: +
1: + while (true) {
1: + ret = fscanf(f, "%llx %c %128s%[^\n]\n", &sym_addr, &sym_type, sym_name,
1: + mod_info);
1: + if (ret == EOF && feof(f))
1: + break;
1: + if (ret < 3) {
1: + p_err("failed to read kallsyms entry: %d", ret);
1: + err = -EINVAL;
1: + goto out;
1: + }
1: + if (strcmp(func->name, sym_name) != 0)
1: + continue;
1: + func->ip = sym_addr;
1: + func->mod[0] = '\0';
1: + /* get module name from [modname] */
1: + if (ret == 4) {
1: + if (sscanf(mod_info, "%*[\t ][%[^]]", func->mod) < 1) {
1: + p_err("failed to read module name");
1: + err = -EINVAL;
1: + goto out;
1: + }
1: + }
1: + p_debug("%s = <ip %llx, mod %s>", func->name, func->ip,
1: + strlen(func->mod) > 0 ? func->mod : "vmlinux");
1: + break;
1: + }
1: out:
1: - fclose(f);
1: - return err;
1: + fclose(f);
1: + return err;
1: }
1:
1: -static void trace_printf(void *ctx, const char *fmt, va_list args)
1: -{
1: - vprintf(fmt, args);
1: +static void trace_printf(void *ctx, const char *fmt, va_list args) {
1: + vprintf(fmt, args);
1: }
1:
1: -#define VALID_NAME "%[A-Za-z0-9\\-_]"
1: -#define ARGDATA "%[^)]"
1: -
1: -static int parse_trace(char *str, struct trace *trace)
1: -{
1: - __u8 i, nr_predicates = 0, nr_entry = 0, nr_return = 0;
1: - char argname[MAX_NAME], membername[MAX_NAME];
1: - char tracestr[MAX_STR], argdata[MAX_STR];
1: - struct func *func = &trace->func;
1: - struct btf_dump_opts opts = { };
1: - char *arg, *saveptr;
1: - int ret;
1: -
1: - copy_without_spaces(tracestr, str);
1: -
1: - p_debug("Parsing trace '%s'", tracestr);
1: -
1: - trace->filter_pid = (__u32)filter_pid;
1: - if (filter_pid)
1: - p_debug("Using pid %lu as filter", trace->filter_pid);
1: -
1: - trace->btf = vmlinux_btf;
1: -
1: - ret = sscanf(tracestr, VALID_NAME "(" ARGDATA ")", func->name, argdata);
1: - if (ret <= 0)
1: - usage();
1: - if (ret == 1) {
1: - if (strlen(tracestr) > strlen(func->name)) {
1: - p_err("Invalid function specification '%s'", tracestr);
1: - usage();
1: - }
1: - argdata[0] = '\0';
1: - p_debug("got func '%s'", func->name);
1: - } else {
1: - if (strlen(tracestr) >
1: - strlen(func->name) + strlen(argdata) + 2) {
1: - p_err("Invalid function specification '%s'", tracestr);
1: - usage();
1: - }
1: - p_debug("got func '%s', args '%s'", func->name, argdata);
1: - trace->flags |= KSNOOP_F_CUSTOM;
1: - }
1: -
1: - ret = get_func_ip_mod(func);
1: - if (ret) {
1: - p_err("could not get address of '%s'", func->name);
1: - return ret;
1: - }
1: - trace->btf = get_btf(func->mod);
1: - if (libbpf_get_error(trace->btf)) {
1: - p_err("could not get BTF for '%s': %s",
1: - strlen(func->mod) ? func->mod : "vmlinux",
1: - libbpf_errstr(trace->btf));
1: - return -ENOENT;
1: - }
1: - trace->dump = btf_dump__new(trace->btf, NULL, &opts, trace_printf);
1: - if (libbpf_get_error(trace->dump)) {
1: - p_err("could not create BTF dump : %n",
1: - libbpf_errstr(trace->btf));
1: - return -EINVAL;
1: - }
1: -
1: - ret = get_func_btf(trace->btf, func);
1: - if (ret) {
1: - p_debug("unexpected return value '%d' getting function", ret);
1: - return ret;
1: - }
1: -
1: - for (arg = strtok_r(argdata, ",", &saveptr), i = 0;
1: - arg;
1: - arg = strtok_r(NULL, ",", &saveptr), i++) {
1: - char *predicate = NULL;
1: -
1: - ret = sscanf(arg, VALID_NAME "->" VALID_NAME,
1: - argname, membername);
1: - if (ret == 2) {
1: - if (strlen(arg) >
1: - strlen(argname) + strlen(membername) + 2) {
1: - predicate = arg + strlen(argname) +
1: - strlen(membername) + 2;
1: - }
1: - p_debug("'%s' dereferences '%s', predicate '%s'",
1: - argname, membername, predicate);
1: - } else {
1: - if (strlen(arg) > strlen(argname))
1: - predicate = arg + strlen(argname);
1: - p_debug("'%s' arg, predcate '%s'", argname, predicate);
1: - membername[0] = '\0';
1: - }
1: -
1: - if (i >= MAX_TRACES) {
1: - p_err("Too many arguments; up to %d are supported",
1: - MAX_TRACES);
1: - return -EINVAL;
1: - }
1: - if (trace_to_value(trace->btf, func, argname, membername,
1: - predicate, &trace->traces[i]))
1: - return -EINVAL;
1: -
1: - if (predicate)
1: - nr_predicates++;
1: - if (trace->traces[i].base_arg == KSNOOP_RETURN)
1: - nr_return++;
1: - else
1: - nr_entry++;
1: - trace->nr_traces++;
1: - }
1: -
1: - if (trace->nr_traces > 0) {
1: - trace->flags |= KSNOOP_F_CUSTOM;
1: - p_debug("custom trace with %d args", trace->nr_traces);
1: -
1: - /* If we have one or more predicates _and_ references to
1: - * entry and return values, we need to activate "stash"
1: - * mode where arg traces are stored on entry and not
1: - * sent until return to ensure predicates are satisfied.
1: - */
1: - if (nr_predicates > 0 && nr_entry > 0 && nr_return > 0) {
1: - trace->flags |= KSNOOP_F_STASH;
1: - p_debug("activating stash mode on entry");
1: - }
1: - } else {
1: - p_debug("Standard trace, function with %d arguments",
1: - func->nr_args);
1: - /* copy function arg/return value to trace specification. */
1: - memcpy(trace->traces, func->args, sizeof(trace->traces));
1: - for (i = 0; i < MAX_TRACES; i++)
1: - trace->traces[i].base_arg = i;
1: - trace->nr_traces = MAX_TRACES;
1: - }
1: -
1: - return 0;
1: +#define VALID_NAME "%[A-Za-z0-9\\-_]"
1: +#define ARGDATA "%[^)]"
1: +
1: +static int parse_trace(char *str, struct trace *trace) {
1: + __u8 i, nr_predicates = 0, nr_entry = 0, nr_return = 0;
1: + char argname[MAX_NAME], membername[MAX_NAME];
1: + char tracestr[MAX_STR], argdata[MAX_STR];
1: + struct func *func = &trace->func;
1: + struct btf_dump_opts opts = {};
1: + char *arg, *saveptr;
1: + int ret;
1: +
1: + copy_without_spaces(tracestr, str);
1: +
1: + p_debug("Parsing trace '%s'", tracestr);
1: +
1: + trace->filter_pid = (__u32)filter_pid;
1: + if (filter_pid)
1: + p_debug("Using pid %lu as filter", trace->filter_pid);
1: +
1: + trace->btf = vmlinux_btf;
1: +
1: + ret = sscanf(tracestr, VALID_NAME "(" ARGDATA ")", func->name, argdata);
1: + if (ret <= 0)
1: + usage();
1: + if (ret == 1) {
1: + if (strlen(tracestr) > strlen(func->name)) {
1: + p_err("Invalid function specification '%s'", tracestr);
1: + usage();
1: + }
1: + argdata[0] = '\0';
1: + p_debug("got func '%s'", func->name);
1: + } else {
1: + if (strlen(tracestr) > strlen(func->name) + strlen(argdata) + 2) {
1: + p_err("Invalid function specification '%s'", tracestr);
1: + usage();
1: + }
1: + p_debug("got func '%s', args '%s'", func->name, argdata);
1: + trace->flags |= KSNOOP_F_CUSTOM;
1: + }
1: +
1: + ret = get_func_ip_mod(func);
1: + if (ret) {
1: + p_err("could not get address of '%s'", func->name);
1: + return ret;
1: + }
1: + trace->btf = get_btf(func->mod);
1: + if (libbpf_get_error(trace->btf)) {
1: + p_err("could not get BTF for '%s': %s",
1: + strlen(func->mod) ? func->mod : "vmlinux", libbpf_errstr(trace->btf));
1: + return -ENOENT;
1: + }
1: + trace->dump = btf_dump__new(trace->btf, NULL, &opts, trace_printf);
1: + if (libbpf_get_error(trace->dump)) {
1: + p_err("could not create BTF dump : %n", libbpf_errstr(trace->btf));
1: + return -EINVAL;
1: + }
1: +
1: + ret = get_func_btf(trace->btf, func);
1: + if (ret) {
1: + p_debug("unexpected return value '%d' getting function", ret);
1: + return ret;
1: + }
1: +
1: + for (arg = strtok_r(argdata, ",", &saveptr), i = 0; arg;
1: + arg = strtok_r(NULL, ",", &saveptr), i++) {
1: + char *predicate = NULL;
1: +
1: + ret = sscanf(arg, VALID_NAME "->" VALID_NAME, argname, membername);
1: + if (ret == 2) {
1: + if (strlen(arg) > strlen(argname) + strlen(membername) + 2) {
1: + predicate = arg + strlen(argname) + strlen(membername) + 2;
1: + }
1: + p_debug("'%s' dereferences '%s', predicate '%s'", argname, membername,
1: + predicate);
1: + } else {
1: + if (strlen(arg) > strlen(argname))
1: + predicate = arg + strlen(argname);
1: + p_debug("'%s' arg, predcate '%s'", argname, predicate);
1: + membername[0] = '\0';
1: + }
1: +
1: + if (i >= MAX_TRACES) {
1: + p_err("Too many arguments; up to %d are supported", MAX_TRACES);
1: + return -EINVAL;
1: + }
1: + if (trace_to_value(trace->btf, func, argname, membername, predicate,
1: + &trace->traces[i]))
1: + return -EINVAL;
1: +
1: + if (predicate)
1: + nr_predicates++;
1: + if (trace->traces[i].base_arg == KSNOOP_RETURN)
1: + nr_return++;
1: + else
1: + nr_entry++;
1: + trace->nr_traces++;
1: + }
1: +
1: + if (trace->nr_traces > 0) {
1: + trace->flags |= KSNOOP_F_CUSTOM;
1: + p_debug("custom trace with %d args", trace->nr_traces);
1: +
1: + /* If we have one or more predicates _and_ references to
1: + * entry and return values, we need to activate "stash"
1: + * mode where arg traces are stored on entry and not
1: + * sent until return to ensure predicates are satisfied.
1: + */
1: + if (nr_predicates > 0 && nr_entry > 0 && nr_return > 0) {
1: + trace->flags |= KSNOOP_F_STASH;
1: + p_debug("activating stash mode on entry");
1: + }
1: + } else {
1: + p_debug("Standard trace, function with %d arguments", func->nr_args);
1: + /* copy function arg/return value to trace specification. */
1: + memcpy(trace->traces, func->args, sizeof(trace->traces));
1: + for (i = 0; i < MAX_TRACES; i++)
1: + trace->traces[i].base_arg = i;
1: + trace->nr_traces = MAX_TRACES;
1: + }
1: +
1: + return 0;
1: }
1:
1: -static int parse_traces(int argc, char **argv, struct trace **traces)
1: -{
1: - __u8 i;
1: -
1: - if (argc == 0)
1: - usage();
1: -
1: - if (argc > MAX_FUNC_TRACES) {
1: - p_err("A maximum of %d traces are supported", MAX_FUNC_TRACES);
1: - return -EINVAL;
1: - }
1: - *traces = calloc(argc, sizeof(struct trace));
1: - if (!*traces) {
1: - p_err("Could not allocate %d traces", argc);
1: - return -ENOMEM;
1: - }
1: - for (i = 0; i < argc; i++) {
1: - if (parse_trace(argv[i], &((*traces)[i])))
1: - return -EINVAL;
1: - if (!stack_mode || i == 0)
1: - continue;
1: - /* tell stack mode trace which function to expect next */
1: - (*traces)[i].prev_ip = (*traces)[i-1].func.ip;
1: - (*traces)[i-1].next_ip = (*traces)[i].func.ip;
1: - }
1: - return i;
1: +static int parse_traces(int argc, char **argv, struct trace **traces) {
1: + __u8 i;
1: +
1: + if (argc == 0)
1: + usage();
1: +
1: + if (argc > MAX_FUNC_TRACES) {
1: + p_err("A maximum of %d traces are supported", MAX_FUNC_TRACES);
1: + return -EINVAL;
1: + }
1: + *traces = calloc(argc, sizeof(struct trace));
1: + if (!*traces) {
1: + p_err("Could not allocate %d traces", argc);
1: + return -ENOMEM;
1: + }
1: + for (i = 0; i < argc; i++) {
1: + if (parse_trace(argv[i], &((*traces)[i])))
1: + return -EINVAL;
1: + if (!stack_mode || i == 0)
1: + continue;
1: + /* tell stack mode trace which function to expect next */
1: + (*traces)[i].prev_ip = (*traces)[i - 1].func.ip;
1: + (*traces)[i - 1].next_ip = (*traces)[i].func.ip;
1: + }
1: + return i;
1: }
1:
1: -static int cmd_info(int argc, char **argv)
1: -{
1: - struct trace *traces;
1: - char str[MAX_STR];
1: - int nr_traces;
1: - __u8 i, j;
1: -
1: - nr_traces = parse_traces(argc, argv, &traces);
1: - if (nr_traces < 0)
1: - return nr_traces;
1: -
1: - for (i = 0; i < nr_traces; i++) {
1: - struct func *func = &traces[i].func;
1: -
1: - printf("%s %s(",
1: - value_to_str(traces[i].btf, &func->args[KSNOOP_RETURN],
1: - str),
1: - func->name);
1: - for (j = 0; j < func->nr_args; j++) {
1: - if (j > 0)
1: - printf(", ");
1: - printf("%s", value_to_str(traces[i].btf, &func->args[j],
1: - str));
1: - }
1: - if (func->nr_args > MAX_ARGS)
1: - printf(" /* and %d more args that are not traceable */",
1: - func->nr_args - MAX_ARGS);
1: - printf(");\n");
1: - }
1: - return 0;
1: +static int cmd_info(int argc, char **argv) {
1: + struct trace *traces;
1: + char str[MAX_STR];
1: + int nr_traces;
1: + __u8 i, j;
1: +
1: + nr_traces = parse_traces(argc, argv, &traces);
1: + if (nr_traces < 0)
1: + return nr_traces;
1: +
1: + for (i = 0; i < nr_traces; i++) {
1: + struct func *func = &traces[i].func;
1: +
1: + printf("%s %s(",
1: + value_to_str(traces[i].btf, &func->args[KSNOOP_RETURN], str),
1: + func->name);
1: + for (j = 0; j < func->nr_args; j++) {
1: + if (j > 0)
1: + printf(", ");
1: + printf("%s", value_to_str(traces[i].btf, &func->args[j], str));
1: + }
1: + if (func->nr_args > MAX_ARGS)
1: + printf(" /* and %d more args that are not traceable */",
1: + func->nr_args - MAX_ARGS);
1: + printf(");\n");
1: + }
1: + return 0;
1: }
1:
1: -static void trace_handler(void *ctx, int cpu, void *data, __u32 size)
1: -{
1: - struct trace *trace = data;
1: - int i, shown, ret;
1: -
1: - p_debug("got trace, size %d", size);
1: - if (size < (sizeof(*trace) - MAX_TRACE_BUF)) {
1: - p_err("\t/* trace buffer size '%u' < min %ld */",
1: - size, sizeof(trace) - MAX_TRACE_BUF);
1: - return;
1: - }
1: - printf("%16lld %4d %8u %s(\n", trace->time, trace->cpu, trace->pid,
1: - trace->func.name);
1: -
1: - for (i = 0, shown = 0; i < trace->nr_traces; i++) {
1: - DECLARE_LIBBPF_OPTS(btf_dump_type_data_opts, opts);
1: - bool entry = trace->data_flags & KSNOOP_F_ENTRY;
1: - struct value *val = &trace->traces[i];
1: - struct trace_data *data = &trace->trace_data[i];
1: -
1: - opts.indent_level = 36;
1: - opts.indent_str = " ";
1: -
1: - /* skip if it's entry data and trace data is for return, or
1: - * if it's return and trace data is entry; only exception in
1: - * the latter case is if we stashed data; in such cases we
1: - * want to see it as it's a mix of entry/return data with
1: - * predicates.
1: - */
1: - if ((entry && !base_arg_is_entry(val->base_arg)) ||
1: - (!entry && base_arg_is_entry(val->base_arg) &&
1: - !(trace->flags & KSNOOP_F_STASH)))
1: - continue;
1: -
1: - if (val->type_id == 0)
1: - continue;
1: -
1: - if (shown > 0)
1: - printf(",\n");
1: - printf("%34s %s = ", "", val->name);
1: - if (val->flags & KSNOOP_F_PTR)
1: - printf("*(0x%llx)", data->raw_value);
1: - printf("\n");
1: -
1: - if (data->err_type_id != 0) {
1: - char typestr[MAX_STR];
1: -
1: - printf("%36s /* Cannot show '%s' as '%s%s'; invalid/userspace ptr? */\n",
1: - "",
1: - val->name,
1: - type_id_to_str(trace->btf,
1: - val->type_id,
1: - typestr),
1: - val->flags & KSNOOP_F_PTR ?
1: - " *" : "");
1: - } else {
1: - ret = btf_dump__dump_type_data
1: - (trace->dump, val->type_id,
1: - trace->buf + data->buf_offset,
1: - data->buf_len, &opts);
1: - /* truncated? */
1: - if (ret == -E2BIG)
1: - printf("%36s... /* %d bytes of %d */", "",
1: - data->buf_len,
1: - val->size);
1: - }
1: - shown++;
1: -
1: - }
1: - printf("\n%31s);\n\n", "");
1: - fflush(stdout);
1: +static void trace_handler(void *ctx, int cpu, void *data, __u32 size) {
1: + struct trace *trace = data;
1: + int i, shown, ret;
1: +
1: + p_debug("got trace, size %d", size);
1: + if (size < (sizeof(*trace) - MAX_TRACE_BUF)) {
1: + p_err("\t/* trace buffer size '%u' < min %ld */", size,
1: + sizeof(trace) - MAX_TRACE_BUF);
1: + return;
1: + }
1: + printf("%16lld %4d %8u %s(\n", trace->time, trace->cpu, trace->pid,
1: + trace->func.name);
1: +
1: + for (i = 0, shown = 0; i < trace->nr_traces; i++) {
1: + DECLARE_LIBBPF_OPTS(btf_dump_type_data_opts, opts);
1: + bool entry = trace->data_flags & KSNOOP_F_ENTRY;
1: + struct value *val = &trace->traces[i];
1: + struct trace_data *data = &trace->trace_data[i];
1: +
1: + opts.indent_level = 36;
1: + opts.indent_str = " ";
1: +
1: + /* skip if it's entry data and trace data is for return, or
1: + * if it's return and trace data is entry; only exception in
1: + * the latter case is if we stashed data; in such cases we
1: + * want to see it as it's a mix of entry/return data with
1: + * predicates.
1: + */
1: + if ((entry && !base_arg_is_entry(val->base_arg)) ||
1: + (!entry && base_arg_is_entry(val->base_arg) &&
1: + !(trace->flags & KSNOOP_F_STASH)))
1: + continue;
1: +
1: + if (val->type_id == 0)
1: + continue;
1: +
1: + if (shown > 0)
1: + printf(",\n");
1: + printf("%34s %s = ", "", val->name);
1: + if (val->flags & KSNOOP_F_PTR)
1: + printf("*(0x%llx)", data->raw_value);
1: + printf("\n");
1: +
1: + if (data->err_type_id != 0) {
1: + char typestr[MAX_STR];
1: +
1: + printf("%36s /* Cannot show '%s' as '%s%s'; invalid/userspace ptr? */\n",
1: + "", val->name, type_id_to_str(trace->btf, val->type_id, typestr),
1: + val->flags & KSNOOP_F_PTR ? " *" : "");
1: + } else {
1: + ret = btf_dump__dump_type_data(trace->dump, val->type_id,
1: + trace->buf + data->buf_offset,
1: + data->buf_len, &opts);
1: + /* truncated? */
1: + if (ret == -E2BIG)
1: + printf("%36s... /* %d bytes of %d */", "", data->buf_len, val->size);
1: + }
1: + shown++;
1: + }
1: + printf("\n%31s);\n\n", "");
1: + fflush(stdout);
1: }
1:
1: -static void lost_handler(void *ctx, int cpu, __u64 cnt)
1: -{
1: - p_err("\t/* lost %llu events */", cnt);
1: +static void lost_handler(void *ctx, int cpu, __u64 cnt) {
1: + p_err("\t/* lost %llu events */", cnt);
1: }
1:
1: static int add_traces(struct bpf_map *func_map, struct trace *traces,
1: - int nr_traces)
1: -{
1: - int i, j, ret, nr_cpus = libbpf_num_possible_cpus();
1: - struct trace *map_traces;
1: -
1: - map_traces = calloc(nr_cpus, sizeof(struct trace));
1: - if (!map_traces) {
1: - p_err("Could not allocate memory for %d traces", nr_traces);
1: - return -ENOMEM;
1: - }
1: - for (i = 0; i < nr_traces; i++) {
1: - for (j = 0; j < nr_cpus; j++)
1: - memcpy(&map_traces[j], &traces[i],
1: - sizeof(map_traces[j]));
1: -
1: - ret = bpf_map_update_elem(bpf_map__fd(func_map),
1: - &traces[i].func.ip,
1: - map_traces,
1: - BPF_NOEXIST);
1: - if (ret) {
1: - p_err("Could not add map entry for '%s': %s",
1: - traces[i].func.name, strerror(-ret));
1: - break;
1: - }
1: - }
1: - free(map_traces);
1: - return ret;
1: + int nr_traces) {
1: + int i, j, ret, nr_cpus = libbpf_num_possible_cpus();
1: + struct trace *map_traces;
1: +
1: + map_traces = calloc(nr_cpus, sizeof(struct trace));
1: + if (!map_traces) {
1: + p_err("Could not allocate memory for %d traces", nr_traces);
1: + return -ENOMEM;
1: + }
1: + for (i = 0; i < nr_traces; i++) {
1: + for (j = 0; j < nr_cpus; j++)
1: + memcpy(&map_traces[j], &traces[i], sizeof(map_traces[j]));
1: +
1: + ret = bpf_map_update_elem(bpf_map__fd(func_map), &traces[i].func.ip,
1: + map_traces, BPF_NOEXIST);
1: + if (ret) {
1: + p_err("Could not add map entry for '%s': %s", traces[i].func.name,
1: + strerror(-ret));
1: + break;
1: + }
1: + }
1: + free(map_traces);
1: + return ret;
1: }
1:
1: static int attach_traces(struct ksnoop_bpf *skel, struct trace *traces,
1: - int nr_traces)
1: -{
1: - struct bpf_link *link;
1: - int i, ret;
1: -
1: - for (i = 0; i < nr_traces; i++) {
1: - link = bpf_program__attach_kprobe(skel->progs.kprobe_entry,
1: - false,
1: - traces[i].func.name);
1: - ret = libbpf_get_error(link);
1: - if (ret) {
1: - p_err("Could not attach kprobe to '%s': %s",
1: - traces[i].func.name, strerror(-ret));
1: - return ret;
1: - }
1: - p_debug("Attached kprobe for '%s'", traces[i].func.name);
1: -
1: - link = bpf_program__attach_kprobe(skel->progs.kprobe_return,
1: - true,
1: - traces[i].func.name);
1: - ret = libbpf_get_error(link);
1: - if (ret) {
1: - p_err("Could not attach kretprobe to '%s': %s",
1: - traces[i].func.name, strerror(-ret));
1: - return ret;
1: - }
1: - p_debug("Attached kretprobe for '%s'", traces[i].func.name);
1: - }
1: - return 0;
1: + int nr_traces) {
1: + struct bpf_link *link;
1: + int i, ret;
1: +
1: + for (i = 0; i < nr_traces; i++) {
1: + link = bpf_program__attach_kprobe(skel->progs.kprobe_entry, false,
1: + traces[i].func.name);
1: + ret = libbpf_get_error(link);
1: + if (ret) {
1: + p_err("Could not attach kprobe to '%s': %s", traces[i].func.name,
1: + strerror(-ret));
1: + return ret;
1: + }
1: + p_debug("Attached kprobe for '%s'", traces[i].func.name);
1: +
1: + link = bpf_program__attach_kprobe(skel->progs.kprobe_return, true,
1: + traces[i].func.name);
1: + ret = libbpf_get_error(link);
1: + if (ret) {
1: + p_err("Could not attach kretprobe to '%s': %s", traces[i].func.name,
1: + strerror(-ret));
1: + return ret;
1: + }
1: + p_debug("Attached kretprobe for '%s'", traces[i].func.name);
1: + }
1: + return 0;
1: }
1:
1: -static int cmd_trace(int argc, char **argv)
1: -{
1: - struct perf_buffer_opts pb_opts = {};
1: - struct bpf_map *perf_map, *func_map;
1: - struct perf_buffer *pb;
1: - struct ksnoop_bpf *skel;
1: - int nr_traces, ret = 0;
1: - struct trace *traces;
1: -
1: - nr_traces = parse_traces(argc, argv, &traces);
1: - if (nr_traces < 0)
1: - return nr_traces;
1: -
1: - skel = ksnoop_bpf__open_and_load();
1: - if (!skel) {
1: - p_err("Could not load ksnoop BPF: %s", libbpf_errstr(skel));
1: - return 1;
1: - }
1: -
1: - perf_map = skel->maps.ksnoop_perf_map;
1: - if (!perf_map) {
1: - p_err("Could not find '%s'", "ksnoop_perf_map");
1: - return 1;
1: - }
1: - func_map = bpf_object__find_map_by_name(skel->obj, "ksnoop_func_map");
1: - if (!func_map) {
1: - p_err("Could not find '%s'", "ksnoop_func_map");
1: - return 1;
1: - }
1: -
1: - if (add_traces(func_map, traces, nr_traces)) {
1: - p_err("Could not add traces to '%s'", "ksnoop_func_map");
1: - return 1;
1: - }
1: -
1: - if (attach_traces(skel, traces, nr_traces)) {
1: - p_err("Could not attach %d traces", nr_traces);
1: - return 1;
1: - }
1: -
1: - pb_opts.sample_cb = trace_handler;
1: - pb_opts.lost_cb = lost_handler;
1: - pb = perf_buffer__new(bpf_map__fd(perf_map), pages, &pb_opts);
1: - if (libbpf_get_error(pb)) {
1: - p_err("Could not create perf buffer: %s",
1: - libbpf_errstr(pb));
1: - return 1;
1: - }
1: -
1: - printf("%16s %4s %8s %s\n", "TIME", "CPU", "PID", "FUNCTION/ARGS");
1: -
1: - while (1) {
1: - ret = perf_buffer__poll(pb, 1);
1: - if (ret < 0 && ret != -EINTR) {
1: - p_err("Polling failed: %s", strerror(-ret));
1: - break;
1: - }
1: - }
1: -
1: - perf_buffer__free(pb);
1: - ksnoop_bpf__destroy(skel);
1: -
1: - return ret;
1: +static int cmd_trace(int argc, char **argv) {
1: + struct perf_buffer_opts pb_opts = {};
1: + struct bpf_map *perf_map, *func_map;
1: + struct perf_buffer *pb;
1: + struct ksnoop_bpf *skel;
1: + int nr_traces, ret = 0;
1: + struct trace *traces;
1: +
1: + nr_traces = parse_traces(argc, argv, &traces);
1: + if (nr_traces < 0)
1: + return nr_traces;
1: +
1: + skel = ksnoop_bpf__open_and_load();
1: + if (!skel) {
1: + p_err("Could not load ksnoop BPF: %s", libbpf_errstr(skel));
1: + return 1;
1: + }
1: +
1: + perf_map = skel->maps.ksnoop_perf_map;
1: + if (!perf_map) {
1: + p_err("Could not find '%s'", "ksnoop_perf_map");
1: + return 1;
1: + }
1: + func_map = bpf_object__find_map_by_name(skel->obj, "ksnoop_func_map");
1: + if (!func_map) {
1: + p_err("Could not find '%s'", "ksnoop_func_map");
1: + return 1;
1: + }
1: +
1: + if (add_traces(func_map, traces, nr_traces)) {
1: + p_err("Could not add traces to '%s'", "ksnoop_func_map");
1: + return 1;
1: + }
1: +
1: + if (attach_traces(skel, traces, nr_traces)) {
1: + p_err("Could not attach %d traces", nr_traces);
1: + return 1;
1: + }
1: +
1: + pb_opts.sample_cb = trace_handler;
1: + pb_opts.lost_cb = lost_handler;
1: + pb = perf_buffer__new(bpf_map__fd(perf_map), pages, &pb_opts);
1: + if (libbpf_get_error(pb)) {
1: + p_err("Could not create perf buffer: %s", libbpf_errstr(pb));
1: + return 1;
1: + }
1: +
1: + printf("%16s %4s %8s %s\n", "TIME", "CPU", "PID", "FUNCTION/ARGS");
1: +
1: + while (1) {
1: + ret = perf_buffer__poll(pb, 1);
1: + if (ret < 0 && ret != -EINTR) {
1: + p_err("Polling failed: %s", strerror(-ret));
1: + break;
1: + }
1: + }
1: +
1: + perf_buffer__free(pb);
1: + ksnoop_bpf__destroy(skel);
1: +
1: + return ret;
1: }
1:
1: struct cmd {
1: - const char *cmd;
1: - int (*func)(int argc, char **argv);
1: + const char *cmd;
1: + int (*func)(int argc, char **argv);
1: };
1:
1: struct cmd cmds[] = {
1: - { "info", cmd_info },
1: - { "trace", cmd_trace },
1: - { "help", cmd_help },
1: - { NULL, NULL }
1: -};
1: + {"info", cmd_info}, {"trace", cmd_trace}, {"help", cmd_help}, {NULL, NULL}};
1:
1: -static int cmd_select(int argc, char **argv)
1: -{
1: - int i;
1: +static int cmd_select(int argc, char **argv) {
1: + int i;
1:
1: - for (i = 0; cmds[i].cmd; i++) {
1: - if (strncmp(*argv, cmds[i].cmd, strlen(*argv)) == 0)
1: - return cmds[i].func(argc - 1, argv + 1);
1: - }
1: - return cmd_trace(argc, argv);
1: + for (i = 0; cmds[i].cmd; i++) {
1: + if (strncmp(*argv, cmds[i].cmd, strlen(*argv)) == 0)
1: + return cmds[i].func(argc - 1, argv + 1);
1: + }
1: + return cmd_trace(argc, argv);
1: }
1:
1: -static int print_all_levels(enum libbpf_print_level level,
1: - const char *format, va_list args)
1: -{
1: - return vfprintf(stderr, format, args);
1: +static int print_all_levels(enum libbpf_print_level level, const char *format,
1: + va_list args) {
1: + return vfprintf(stderr, format, args);
1: }
1:
1: -int main(int argc, char *argv[])
1: -{
1: - static const struct option options[] = {
1: - { "debug", no_argument, NULL, 'd' },
1: - { "help", no_argument, NULL, 'h' },
1: - { "version", no_argument, NULL, 'V' },
1: - { "pages", required_argument, NULL, 'P' },
1: - { "pid", required_argument, NULL, 'p' },
1: - { 0 }
1: - };
1: - int opt;
1: -
1: - bin_name = argv[0];
1: -
1: - while ((opt = getopt_long(argc, argv, "dhp:P:sV", options,
1: - NULL)) >= 0) {
1: - switch (opt) {
1: - case 'd':
1: - libbpf_set_print(print_all_levels);
1: - log_level = DEBUG;
1: - break;
1: - case 'h':
1: - return cmd_help(argc, argv);
1: - case 'V':
1: - return do_version(argc, argv);
1: - case 'p':
1: - filter_pid = atoi(optarg);
1: - break;
1: - case 'P':
1: - pages = atoi(optarg);
1: - break;
1: - case 's':
1: - stack_mode = true;
1: - break;
1: - default:
1: - p_err("unrecognized option '%s'", argv[optind - 1]);
1: - usage();
1: - }
1: - }
1: - if (argc == 1)
1: - usage();
1: - argc -= optind;
1: - argv += optind;
1: - if (argc < 0)
1: - usage();
1: -
1: - return cmd_select(argc, argv);
1: +int main(int argc, char *argv[]) {
1: + static const struct option options[] = {
1: + {"debug", no_argument, NULL, 'd'},
1: + {"help", no_argument, NULL, 'h'},
1: + {"version", no_argument, NULL, 'V'},
1: + {"pages", required_argument, NULL, 'P'},
1: + {"pid", required_argument, NULL, 'p'},
1: + {0}};
1: + int opt;
1: +
1: + bin_name = argv[0];
1: +
1: + while ((opt = getopt_long(argc, argv, "dhp:P:sV", options, NULL)) >= 0) {
1: + switch (opt) {
1: + case 'd':
1: + libbpf_set_print(print_all_levels);
1: + log_level = DEBUG;
1: + break;
1: + case 'h':
1: + return cmd_help(argc, argv);
1: + case 'V':
1: + return do_version(argc, argv);
1: + case 'p':
1: + filter_pid = atoi(optarg);
1: + break;
1: + case 'P':
1: + pages = atoi(optarg);
1: + break;
1: + case 's':
1: + stack_mode = true;
1: + break;
1: + default:
1: + p_err("unrecognized option '%s'", argv[optind - 1]);
1: + usage();
1: + }
1: + }
1: + if (argc == 1)
1: + usage();
1: + argc -= optind;
1: + argv += optind;
1: + if (argc < 0)
1: + usage();
1: +
1: + return cmd_select(argc, argv);
1: }
1: diff --git a/libbpf-tools/ksnoop.h b/libbpf-tools/ksnoop.h
1: index 6c55b0ef..64f77d41 100644
1: --- a/libbpf-tools/ksnoop.h
1: +++ b/libbpf-tools/ksnoop.h
1: @@ -2,121 +2,120 @@
1: /* Copyright (c) 2021, Oracle and/or its affiliates. */
1:
1: /* maximum number of different functions we can trace at once */
1: -#define MAX_FUNC_TRACES 64
1: +#define MAX_FUNC_TRACES 64
1:
1: enum arg {
1: - KSNOOP_ARG1,
1: - KSNOOP_ARG2,
1: - KSNOOP_ARG3,
1: - KSNOOP_ARG4,
1: - KSNOOP_ARG5,
1: - KSNOOP_RETURN
1: + KSNOOP_ARG1,
1: + KSNOOP_ARG2,
1: + KSNOOP_ARG3,
1: + KSNOOP_ARG4,
1: + KSNOOP_ARG5,
1: + KSNOOP_RETURN
1: };
1:
1: /* we choose "return" as the name for the returned value because as
1: * a C keyword it can't clash with a function entry parameter.
1: */
1: -#define KSNOOP_RETURN_NAME "return"
1: +#define KSNOOP_RETURN_NAME "return"
1:
1: /* if we can't get a type id for a type (such as module-specific type)
1: * mark it as KSNOOP_ID_UNKNOWN since BTF lookup in bpf_snprintf_btf()
1: * will fail and the data will be simply displayed as a __u64.
1: */
1: -#define KSNOOP_ID_UNKNOWN 0xffffffff
1: -
1: -#define MAX_NAME 96
1: -#define MAX_STR 256
1: -#define MAX_PATH 512
1: -#define MAX_VALUES 6
1: -#define MAX_ARGS (MAX_VALUES - 1)
1: -#define KSNOOP_F_PTR 0x1 /* value is a pointer */
1: -#define KSNOOP_F_MEMBER 0x2 /* member reference */
1: -#define KSNOOP_F_ENTRY 0x4
1: -#define KSNOOP_F_RETURN 0x8
1: -#define KSNOOP_F_CUSTOM 0x10 /* custom trace */
1: -#define KSNOOP_F_STASH 0x20 /* store values on entry,
1: - * no perf events.
1: - */
1: -#define KSNOOP_F_STASHED 0x40 /* values stored on entry */
1: -
1: -#define KSNOOP_F_PREDICATE_EQ 0x100
1: -#define KSNOOP_F_PREDICATE_NOTEQ 0x200
1: -#define KSNOOP_F_PREDICATE_GT 0x400
1: -#define KSNOOP_F_PREDICATE_LT 0x800
1: -
1: -#define KSNOOP_F_PREDICATE_MASK (KSNOOP_F_PREDICATE_EQ | \
1: - KSNOOP_F_PREDICATE_NOTEQ | \
1: - KSNOOP_F_PREDICATE_GT | \
1: - KSNOOP_F_PREDICATE_LT)
1: +#define KSNOOP_ID_UNKNOWN 0xffffffff
1: +
1: +#define MAX_NAME 96
1: +#define MAX_STR 256
1: +#define MAX_PATH 512
1: +#define MAX_VALUES 6
1: +#define MAX_ARGS (MAX_VALUES - 1)
1: +#define KSNOOP_F_PTR 0x1 /* value is a pointer */
1: +#define KSNOOP_F_MEMBER 0x2 /* member reference */
1: +#define KSNOOP_F_ENTRY 0x4
1: +#define KSNOOP_F_RETURN 0x8
1: +#define KSNOOP_F_CUSTOM 0x10 /* custom trace */
1: +#define KSNOOP_F_STASH \
1: + 0x20 /* store values on entry, \
1: + * no perf events. \
1: + */
1: +#define KSNOOP_F_STASHED 0x40 /* values stored on entry */
1: +
1: +#define KSNOOP_F_PREDICATE_EQ 0x100
1: +#define KSNOOP_F_PREDICATE_NOTEQ 0x200
1: +#define KSNOOP_F_PREDICATE_GT 0x400
1: +#define KSNOOP_F_PREDICATE_LT 0x800
1: +
1: +#define KSNOOP_F_PREDICATE_MASK \
1: + (KSNOOP_F_PREDICATE_EQ | KSNOOP_F_PREDICATE_NOTEQ | KSNOOP_F_PREDICATE_GT | \
1: + KSNOOP_F_PREDICATE_LT)
1:
1: /* for kprobes, entry is function IP + sizeof(kprobe_opcode_t),
1: * subtract in BPF prog context to get fn address.
1: */
1: #ifdef __TARGET_ARCH_x86
1: -#define KSNOOP_IP_FIX(ip) (ip - sizeof(kprobe_opcode_t))
1: +#define KSNOOP_IP_FIX(ip) (ip - sizeof(kprobe_opcode_t))
1: #else
1: -#define KSNOOP_IP_FIX(ip) ip
1: +#define KSNOOP_IP_FIX(ip) ip
1: #endif
1:
1: struct value {
1: - char name[MAX_STR];
1: - enum arg base_arg;
1: - __u32 offset;
1: - __u32 size;
1: - __u64 type_id;
1: - __u64 flags;
1: - __u64 predicate_value;
1: + char name[MAX_STR];
1: + enum arg base_arg;
1: + __u32 offset;
1: + __u32 size;
1: + __u64 type_id;
1: + __u64 flags;
1: + __u64 predicate_value;
1: };
1:
1: struct func {
1: - char name[MAX_NAME];
1: - char mod[MAX_NAME];
1: - __s32 id;
1: - __u8 nr_args;
1: - __u64 ip;
1: - struct value args[MAX_VALUES];
1: + char name[MAX_NAME];
1: + char mod[MAX_NAME];
1: + __s32 id;
1: + __u8 nr_args;
1: + __u64 ip;
1: + struct value args[MAX_VALUES];
1: };
1:
1: #define MAX_TRACES MAX_VALUES
1:
1: -#define MAX_TRACE_DATA 2048
1: +#define MAX_TRACE_DATA 2048
1:
1: struct trace_data {
1: - __u64 raw_value;
1: - __u32 err_type_id; /* type id we can't dereference */
1: - int err;
1: - __u32 buf_offset;
1: - __u16 buf_len;
1: + __u64 raw_value;
1: + __u32 err_type_id; /* type id we can't dereference */
1: + int err;
1: + __u32 buf_offset;
1: + __u16 buf_len;
1: };
1:
1: -#define MAX_TRACE_BUF (MAX_TRACES * MAX_TRACE_DATA)
1: +#define MAX_TRACE_BUF (MAX_TRACES * MAX_TRACE_DATA)
1:
1: struct trace {
1: - /* initial values are readonly in tracing context */
1: - struct btf *btf;
1: - struct btf_dump *dump;
1: - struct func func;
1: - __u8 nr_traces;
1: - __u32 filter_pid;
1: - __u64 prev_ip; /* these are used in stack-mode tracing */
1: - __u64 next_ip;
1: - struct value traces[MAX_TRACES];
1: - __u64 flags;
1: - /* values below this point are set or modified in tracing context */
1: - __u64 task;
1: - __u32 pid;
1: - __u32 cpu;
1: - __u64 time;
1: - __u64 data_flags;
1: - struct trace_data trace_data[MAX_TRACES];
1: - __u16 buf_len;
1: - char buf[MAX_TRACE_BUF];
1: - char buf_end[0];
1: + /* initial values are readonly in tracing context */
1: + struct btf *btf;
1: + struct btf_dump *dump;
1: + struct func func;
1: + __u8 nr_traces;
1: + __u32 filter_pid;
1: + __u64 prev_ip; /* these are used in stack-mode tracing */
1: + __u64 next_ip;
1: + struct value traces[MAX_TRACES];
1: + __u64 flags;
1: + /* values below this point are set or modified in tracing context */
1: + __u64 task;
1: + __u32 pid;
1: + __u32 cpu;
1: + __u64 time;
1: + __u64 data_flags;
1: + struct trace_data trace_data[MAX_TRACES];
1: + __u16 buf_len;
1: + char buf[MAX_TRACE_BUF];
1: + char buf_end[0];
1: };
1:
1: -#define PAGES_DEFAULT 16
1: +#define PAGES_DEFAULT 16
1:
1: -static inline int base_arg_is_entry(enum arg base_arg)
1: -{
1: - return base_arg != KSNOOP_RETURN;
1: +static inline int base_arg_is_entry(enum arg base_arg) {
1: + return base_arg != KSNOOP_RETURN;
1: }
1: Ignoring changes in the following files (wrong extension):
1: libbpf-tools/Makefile
1: libbpf-tools/.gitignore
1: src/cc/libbpf
1: man/man8/ksnoop.8
1: Running clang-format on the following files:
1: libbpf-tools/ksnoop.h
1: libbpf-tools/ksnoop.bpf.c
1: libbpf-tools/ksnoop.c
1: old tree: 675c000024a766bd7b1c4f8b9469349951c8f924
1: new tree: eb52c045c2f9e27db855286351e9d24599b82fb0
1/47 Test #1: style-check ...................... Passed 1.95 sec
test 2
Start 2: c_test_static
2: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "c_test_static" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/cc/test_static"
2: Test timeout computed to be: 10000000
2: clang -cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -emit-llvm-uselists -disable-free -disable-llvm-verifier -discard-value-names -main-file-name main.c -mrelocation-model static -mthread-model posix -fno-jump-tables -fmath-errno -masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu x86-64 -momit-leaf-frame-pointer -dwarf-column-info -debugger-tuning=gdb -coverage-notes-file /usr/src/kernels/4.15.15-300.fc27.x86_64/main.gcno -nostdsysteminc -nobuiltininc -resource-dir lib64/clang/5.0.1 -isystem /virtual/lib/clang/include -include ./include/linux/kconfig.h -include /virtual/include/bcc/bpf.h -include /virtual/include/bcc/bpf_workaround.h -include /virtual/include/bcc/helpers.h -isystem /virtual/include -I /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/cc -D __BPF_TRACING__ -I arch/x86/include/ -I /lib/modules/4.15.15-300.fc27.x86_64/build/arch/x86/include/generated -I include -I /lib/modules/4.15.15-300.fc27.x86_64/build/include -I arch/x86/include/uapi -I /lib/modules/4.15.15-300.fc27.x86_64/build/arch/x86/include/generated/uapi -I include/uapi -I /lib/modules/4.15.15-300.fc27.x86_64/build/include/generated/uapi -D __KERNEL__ -D KBUILD_MODNAME="bcc" -O2 -Wno-deprecated-declarations -Wno-gnu-variable-sized-type-not-at-end -Wno-pragma-once-outside-header -Wno-address-of-packed-member -Wno-unknown-warning-option -Wno-unused-value -Wno-pointer-sign -fdebug-compilation-dir /usr/src/kernels/4.15.15-300.fc27.x86_64 -ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc -fdiagnostics-show-option -vectorize-loops -vectorize-slp -o main.bc -x c /virtual/main.c
2: #if defined(BPF_LICENSE)
2: #error BPF_LICENSE cannot be specified through cflags
2: #endif
2: #if !defined(CONFIG_CC_STACKPROTECTOR)
2: #if defined(CONFIG_CC_STACKPROTECTOR_AUTO) \
2: || defined(CONFIG_CC_STACKPROTECTOR_REGULAR) \
2: || defined(CONFIG_CC_STACKPROTECTOR_STRONG)
2: #define CONFIG_CC_STACKPROTECTOR
2: #endif
2: #endif
2: #define bpf_probe_read_kernel bpf_probe_read
2: #define bpf_probe_read_kernel_str bpf_probe_read_str
2: #define bpf_probe_read_user bpf_probe_read
2: #define bpf_probe_read_user_str bpf_probe_read_str
2: BPF_TABLE("array", int, int, stats, 10);
2:
2: #include <bcc/footer.h>
2: Running from kernel directory at: /lib/modules/4.15.15-300.fc27.x86_64/source
2/47 Test #2: c_test_static .................... Passed 1.50 sec
test 3
Start 3: test_libbcc
3: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "c_test_all" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/cc/test_libbcc"
3: Test timeout computed to be: 10000000
3: Parse error:
3: 4@i%ra+1r
3: -------^
3: unshare: failed to execute ruby: No such file or directory
3:
3: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3: test_libbcc is a Catch v1.4.0 host application.
3: Run with -? for options
3:
3: -------------------------------------------------------------------------------
3: test probing running Ruby process in namespaces
3: in separate mount namespace
3: -------------------------------------------------------------------------------
3: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/cc/test_usdt_probes.cc:352
3: ...............................................................................
3:
3: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/cc/test_usdt_probes.cc:367: FAILED:
3: REQUIRE( res.msg() == "" )
3: with expansion:
3: "Unable to load USDT ruby:gc__mark__begin from binary PID 6121 for probe
3: on_event"
3: ==
3: ""
3:
3: unshare: unrecognized option '--kill-child'
3: Try 'unshare --help' for more information.
3: -------------------------------------------------------------------------------
3: test probing running Ruby process in namespaces
3: in separate mount namespace and separate PID namespace
3: -------------------------------------------------------------------------------
3: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/cc/test_usdt_probes.cc:352
3: ...............................................................................
3:
3: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/cc/test_usdt_probes.cc:393: FAILED:
3: REQUIRE( res.msg() == "" )
3: with expansion:
3: "No valid Binary Path or PID provided"
3: ==
3: ""
3:
3: ===============================================================================
3: test cases: 41 | 40 passed | 1 failed as expected
3: assertions: 675 | 673 passed | 2 failed as expected
3:
3/47 Test #3: test_libbcc ...................... Passed 15.71 sec
test 4
Start 4: py_test_stat1_b
4: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_stat1_b" "namespace" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_stat1.py" "test_stat1.b" "proto.b"
4: Test timeout computed to be: 10000000
4: Actual changes:
4: tx-checksumming: off
4: tx-checksum-ip-generic: off
4: tx-checksum-sctp: off
4: tcp-segmentation-offload: off
4: tx-tcp-segmentation: off [requested on]
4: tx-tcp-ecn-segmentation: off [requested on]
4: tx-tcp-mangleid-segmentation: off [requested on]
4: tx-tcp6-segmentation: off [requested on]
4: .PING 172.16.1.1 (172.16.1.1) 56(84) bytes of data.
4: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4: --- 172.16.1.1 ping statistics ---
4: 100 packets transmitted, 100 received, 0% packet loss, time 2ms
4: rtt min/avg/max/mdev = 0.005/0.008/0.064/0.007 ms, ipg/ewma 0.020/0.008 ms
4: .
4: ----------------------------------------------------------------------
4: Ran 2 tests in 0.531s
4:
4: OK
4/47 Test #4: py_test_stat1_b .................. Passed 1.35 sec
test 5
Start 5: py_test_bpf_log
5: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_bpf_prog" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_bpf_log.py"
5: Test timeout computed to be: 10000000
5/47 Test #5: py_test_bpf_log .................. Passed 1.04 sec
test 6
Start 6: py_test_stat1_c
6: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_stat1_c" "namespace" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_stat1.py" "test_stat1.c"
6: Test timeout computed to be: 10000000
6: Actual changes:
6: tx-checksumming: off
6: tx-checksum-ip-generic: off
6: tx-checksum-sctp: off
6: tcp-segmentation-offload: off
6: tx-tcp-segmentation: off [requested on]
6: tx-tcp-ecn-segmentation: off [requested on]
6: tx-tcp-mangleid-segmentation: off [requested on]
6: tx-tcp6-segmentation: off [requested on]
6: .PING 172.16.1.1 (172.16.1.1) 56(84) bytes of data.
6: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6: --- 172.16.1.1 ping statistics ---
6: 100 packets transmitted, 100 received, 0% packet loss, time 1ms
6: rtt min/avg/max/mdev = 0.005/0.007/0.060/0.006 ms, ipg/ewma 0.020/0.007 ms
6: .
6: ----------------------------------------------------------------------
6: Ran 2 tests in 0.527s
6:
6: OK
6/47 Test #6: py_test_stat1_c .................. Passed 0.93 sec
test 7
Start 7: py_test_xlate1_c
7: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_xlate1_c" "namespace" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_xlate1.py" "test_xlate1.c"
7: Test timeout computed to be: 10000000
7: Actual changes:
7: tx-checksumming: off
7: tx-checksum-ip-generic: off
7: tx-checksum-sctp: off
7: tcp-segmentation-offload: off
7: tx-tcp-segmentation: off [requested on]
7: tx-tcp-ecn-segmentation: off [requested on]
7: tx-tcp-mangleid-segmentation: off [requested on]
7: tx-tcp6-segmentation: off [requested on]
7: PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
7: 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.102 ms
7:
7: --- 192.168.1.1 ping statistics ---
7: 1 packets transmitted, 1 received, 0% packet loss, time 0ms
7: rtt min/avg/max/mdev = 0.102/0.102/0.102/0.000 ms
7: .
7: ----------------------------------------------------------------------
7: Ran 1 test in 0.540s
7:
7: OK
7/47 Test #7: py_test_xlate1_c ................. Passed 1.23 sec
test 8
Start 8: py_test_call1
8: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_call1_c" "namespace" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_call1.py" "test_call1.c"
8: Test timeout computed to be: 10000000
8: Actual changes:
8: tx-checksumming: off
8: tx-checksum-ip-generic: off
8: tx-checksum-sctp: off
8: tcp-segmentation-offload: off
8: tx-tcp-segmentation: off [requested on]
8: tx-tcp-ecn-segmentation: off [requested on]
8: tx-tcp-mangleid-segmentation: off [requested on]
8: tx-tcp6-segmentation: off [requested on]
8: .
8: ----------------------------------------------------------------------
8: Ran 1 test in 0.284s
8:
8: OK
8/47 Test #8: py_test_call1 .................... Passed 0.94 sec
test 9
Start 9: py_test_trace1
9: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_trace1" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_trace1.py" "test_trace1.b" "kprobe.b"
9: Test timeout computed to be: 10000000
9: .
9: ----------------------------------------------------------------------
9: Ran 1 test in 0.430s
9:
9: OK
9: ('fd 8:', 'stat1 1', 'stat2 1')
9: ('fd ffff947f14cb4600:', 'stat1 2', 'stat2 0')
9: ('fd 9:', 'stat1 200', 'stat2 100')
9: ('fd 7:', 'stat1 0', 'stat2 1')
9/47 Test #9: py_test_trace1 ................... Passed 0.58 sec
test 10
Start 10: py_test_trace2
10: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_trace2" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_trace2.py"
10: Test timeout computed to be: 10000000
10: .
10: ----------------------------------------------------------------------
10: Ran 1 test in 4.014s
10:
10: OK
10: ('ptr ffff947f128c8000:', 'stat1 (0 20)')
10: ('ptr ffff947ee9588000:', 'stat1 (0 101)')
10: ('ptr ffff947f134e1f40:', 'stat1 (0 5)')
10: ('ptr ffff947f14720000:', 'stat1 (0 1)')
10: ('ptr ffff947f16a09f40:', 'stat1 (0 32)')
10: ('ptr ffffffffbf212480:', 'stat1 (0 100)')
10: ('ptr ffff947f169e0000:', 'stat1 (0 3)')
10: ('ptr ffff947f148c3e80:', 'stat1 (0 1)')
10: ('ptr ffff947f1363ddc0:', 'stat1 (0 1)')
10: ('ptr ffff947f11d69f40:', 'stat1 (0 1)')
10/47 Test #10: py_test_trace2 ................... Passed 4.12 sec
test 11
Start 11: py_test_trace3_c
11: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_trace3_c" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_trace3.py" "test_trace3.c"
11: Test timeout computed to be: 10000000
11: 1024+0 records in
11: 1024+0 records out
11: 4194304 bytes (4.2 MB, 4.0 MiB) copied, 0.00399147 s, 1.1 GB/s
11: 1024+0 records in
11: 1024+0 records out
11: 4194304 bytes (4.2 MB, 4.0 MiB) copied, 0.004259 s, 985 MB/s
11: ('latency 0:', 'count 0')
11: ('latency 1:', 'count 0')
11: ('latency 2:', 'count 0')
11: ('latency 3:', 'count 0')
11: ('latency 4:', 'count 0')
11: ('latency 5:', 'count 0')
11: ('latency 6:', 'count 0')
11: ('latency 7:', 'count 0')
11: ('latency 8:', 'count 0')
11: ('latency 9:', 'count 0')
11: ('latency 10:', 'count 0')
11: ('latency 11:', 'count 0')
11: ('latency 12:', 'count 0')
11: ('latency 13:', 'count 0')
11: ('latency 14:', 'count 0')
11: ('latency 15:', 'count 0')
11: ('latency 16:', 'count 0')
11: ('latency 17:', 'count 0')
11: ('latency 18:', 'count 0')
11: ('latency 19:', 'count 0')
11: ('latency 20:', 'count 0')
11: ('latency 21:', 'count 0')
11: ('latency 22:', 'count 0')
11: ('latency 23:', 'count 0')
11: ('latency 24:', 'count 0')
11: ('latency 25:', 'count 0')
11: ('latency 26:', 'count 0')
11: ('latency 27:', 'count 0')
11: ('latency 28:', 'count 0')
11: ('latency 29:', 'count 0')
11: ('latency 30:', 'count 0')
11: ('latency 31:', 'count 0')
11: ('latency 32:', 'count 0')
11: ('latency 33:', 'count 0')
11: ('latency 34:', 'count 0')
11: ('latency 35:', 'count 0')
11: ('latency 36:', 'count 0')
11: ('latency 37:', 'count 0')
11: ('latency 38:', 'count 0')
11: ('latency 39:', 'count 0')
11: ('latency 40:', 'count 0')
11: ('latency 41:', 'count 0')
11: ('latency 42:', 'count 0')
11: ('latency 43:', 'count 0')
11: ('latency 44:', 'count 0')
11: ('latency 45:', 'count 0')
11: ('latency 46:', 'count 1')
11: ('latency 47:', 'count 1')
11: ('latency 48:', 'count 2')
11: ('latency 49:', 'count 0')
11: ('latency 50:', 'count 0')
11: ('latency 51:', 'count 0')
11: ('latency 52:', 'count 0')
11: ('latency 53:', 'count 0')
11: ('latency 54:', 'count 0')
11: ('latency 55:', 'count 0')
11: ('latency 56:', 'count 1')
11: ('latency 57:', 'count 7')
11: ('latency 58:', 'count 14')
11: ('latency 59:', 'count 15')
11: ('latency 60:', 'count 37')
11: ('latency 61:', 'count 14')
11: ('latency 62:', 'count 69')
11: ('latency 63:', 'count 59')
11: ('latency 64:', 'count 57')
11: ('latency 65:', 'count 39')
11: ('latency 66:', 'count 54')
11: ('latency 67:', 'count 34')
11: ('latency 68:', 'count 1')
11: ('latency 69:', 'count 1')
11: ('latency 70:', 'count 0')
11: ('latency 71:', 'count 0')
11: ('latency 72:', 'count 0')
11: ('latency 73:', 'count 0')
11: ('latency 74:', 'count 0')
11: ('latency 75:', 'count 0')
11: ('latency 76:', 'count 0')
11: ('latency 77:', 'count 0')
11: ('latency 78:', 'count 0')
11: ('latency 79:', 'count 0')
11: ('latency 80:', 'count 0')
11: ('latency 81:', 'count 0')
11: ('latency 82:', 'count 0')
11: ('latency 83:', 'count 0')
11: ('latency 84:', 'count 0')
11: ('latency 85:', 'count 0')
11: ('latency 86:', 'count 0')
11: ('latency 87:', 'count 0')
11: ('latency 88:', 'count 0')
11: ('latency 89:', 'count 0')
11: ('latency 90:', 'count 0')
11: ('latency 91:', 'count 0')
11: ('latency 92:', 'count 0')
11: ('latency 93:', 'count 0')
11: ('latency 94:', 'count 0')
11: ('latency 95:', 'count 0')
11: ('latency 96:', 'count 0')
11: ('latency 97:', 'count 0')
11: ('latency 98:', 'count 0')
11: ('latency 99:', 'count 0')
11: .
11: ----------------------------------------------------------------------
11: Ran 1 test in 2.243s
11:
11: OK
11/47 Test #11: py_test_trace3_c ................. Passed 2.38 sec
test 12
Start 12: py_test_trace4
12: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_trace4" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_trace4.py"
12: Test timeout computed to be: 10000000
12: ..
12: ----------------------------------------------------------------------
12: Ran 2 tests in 1.430s
12:
12: OK
12/47 Test #12: py_test_trace4 ................... Passed 1.58 sec
test 13
Start 13: py_test_trace_maxactive
13: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_trace_maxactive" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_trace_maxactive.py"
13: Test timeout computed to be: 10000000
13: .
13: ----------------------------------------------------------------------
13: Ran 1 test in 0.901s
13:
13: OK
13/47 Test #13: py_test_trace_maxactive .......... Passed 1.02 sec
test 14
Start 14: py_test_probe_count
14: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_probe_count" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_probe_count.py"
14: Test timeout computed to be: 10000000
14: ...cannot attach kprobe, probe entry may not exist
14: ...
14: ----------------------------------------------------------------------
14: Ran 6 tests in 3.843s
14:
14: OK
14/47 Test #14: py_test_probe_count .............. Passed 3.92 sec
test 15
Start 15: py_test_debuginfo
15: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_test_debuginfo" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_debuginfo.py"
15: Test timeout computed to be: 10000000
15: ......
15: ----------------------------------------------------------------------
15: Ran 6 tests in 0.609s
15:
15: OK
15/47 Test #15: py_test_debuginfo ................ Passed 0.70 sec
test 16
Start 16: py_test_brb
16: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_brb_c" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_brb.py" "test_brb.c"
16: Test timeout computed to be: 10000000
16: net.ipv4.ip_forward = 1
16: ARPING 100.1.1.254 from 100.1.1.1 eth0
16: Unicast reply from 100.1.1.254 [4A:E3:9F:48:AA:B6] 1.906ms
16: Sent 1 probes (1 broadcast(s))
16: Received 1 response(s)
16: ARPING 200.1.1.254 from 200.1.1.1 eth0
16: Unicast reply from 200.1.1.254 [F6:4E:84:C5:3F:AC] 2.405ms
16: Sent 1 probes (1 broadcast(s))
16: Received 1 response(s)
16: PING 200.1.1.1 (200.1.1.1) 56(84) bytes of data.
16: 64 bytes from 200.1.1.1: icmp_seq=1 ttl=63 time=0.164 ms
16: 64 bytes from 200.1.1.1: icmp_seq=2 ttl=63 time=0.068 ms
16:
16: --- 200.1.1.1 ping statistics ---
16: 2 packets transmitted, 2 received, 0% packet loss, time 1055ms
16: rtt min/avg/max/mdev = 0.068/0.116/0.164/0.048 ms
16: [ ID] Interval Transfer Bandwidth
16: [ 9] 0.0- 1.0 sec 2.21 GBytes 19.0 Gbits/sec
16: [ ID] Interval Transfer Bandwidth
16: [ 10] 0.0- 1.0 sec 2.21 GBytes 18.8 Gbits/sec
16: Starting netserver with host 'IN(6)ADDR_ANY' port '12865' and family AF_UNSPEC
16: MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 200.1.1.1 () port 0 AF_INET
16: Recv Send Send
16: Socket Socket Message Elapsed
16: Size Size Size Time Throughput
16: bytes bytes bytes secs. 10^6bits/sec
16:
16: 87380 16384 65160 1.00 17628.71
16: MIGRATED TCP REQUEST/RESPONSE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 200.1.1.1 () port 0 AF_INET : first burst 0
16: Local /Remote
16: Socket Size Request Resp. Elapsed Trans.
16: Send Recv Size Size Time Rate
16: bytes Bytes bytes bytes secs. per sec
16:
16: 16384 87380 1 1 1.00 23717.11
16: 16384 87380
16: .
16: ----------------------------------------------------------------------
16: Ran 1 test in 7.785s
16:
16: OK
16/47 Test #16: py_test_brb ...................... Passed 7.94 sec
test 17
Start 17: py_test_brb2
17: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_brb2_c" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_brb2.py" "test_brb2.c"
17: Test timeout computed to be: 10000000
17: net.ipv4.ip_forward = 1
17: PING 200.1.1.1 (200.1.1.1) 56(84) bytes of data.
17: 64 bytes from 200.1.1.1: icmp_seq=1 ttl=63 time=0.154 ms
17: 64 bytes from 200.1.1.1: icmp_seq=2 ttl=63 time=0.074 ms
17:
17: --- 200.1.1.1 ping statistics ---
17: 2 packets transmitted, 2 received, 0% packet loss, time 1001ms
17: rtt min/avg/max/mdev = 0.074/0.114/0.154/0.040 ms
17: [ ID] Interval Transfer Bandwidth
17: [ 9] 0.0- 1.0 sec 2.23 GBytes 19.2 Gbits/sec
17: [ ID] Interval Transfer Bandwidth
17: [ 10] 0.0- 1.0 sec 2.23 GBytes 19.0 Gbits/sec
17: Starting netserver with host 'IN(6)ADDR_ANY' port '12865' and family AF_UNSPEC
17: MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 200.1.1.1 () port 0 AF_INET
17: Recv Send Send
17: Socket Socket Message Elapsed
17: Size Size Size Time Throughput
17: bytes bytes bytes secs. 10^6bits/sec
17:
17: 87380 16384 65160 1.00 20884.41
17: MIGRATED TCP REQUEST/RESPONSE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 200.1.1.1 () port 0 AF_INET : first burst 0
17: Local /Remote
17: Socket Size Request Resp. Elapsed Trans.
17: Send Recv Size Size Time Rate
17: bytes Bytes bytes bytes secs. per sec
17:
17: 16384 87380 1 1 1.00 22113.47
17: 16384 87380
17: .
17: ----------------------------------------------------------------------
17: Ran 1 test in 7.760s
17:
17: OK
17/47 Test #17: py_test_brb2 ..................... Passed 7.89 sec
test 18
Start 18: py_test_clang
18: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_clang" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_clang.py"
18: Test timeout computed to be: 10000000
18: ................./virtual/main.c:2:1: error: field has incomplete type 'struct key_t'
18: BPF_HASH(drops, struct key_t);
18: ^
18: /virtual/include/bcc/helpers.h:257:48: note: expanded from macro 'BPF_HASH'
18: BPF_HASHX(__VA_ARGS__, BPF_HASH4, BPF_HASH3, BPF_HASH2, BPF_HASH1)(__VA_ARGS__)
18: ^
18: /virtual/main.c:2:24: note: forward declaration of 'struct key_t'
18: BPF_HASH(drops, struct key_t);
18: ^
18: /virtual/main.c:2:1: error: field has incomplete type 'struct key_t'
18: BPF_HASH(drops, struct key_t);
18: ^
18: /virtual/include/bcc/helpers.h:257:48: note: expanded from macro 'BPF_HASH'
18: BPF_HASHX(__VA_ARGS__, BPF_HASH4, BPF_HASH3, BPF_HASH2, BPF_HASH1)(__VA_ARGS__)
18: ^
18: /virtual/main.c:2:24: note: forward declaration of 'struct key_t'
18: BPF_HASH(drops, struct key_t);
18: ^
18: 2 errors generated.
18: ../virtual/main.c:6:12: error: cannot call non-static helper function
18: return bar();
18: ^
18: 1 error generated.
18: ...s....................................../virtual/main.c:7:12: warning: incompatible pointer to integer conversion returning 'u32 *' (aka 'unsigned int *') from a function with result type 'int' [-Wint-conversion]
18: return *(&skp->sk_daddr);
18: ^~~~~~~~~~~~~~~~~
18: 1 warning generated.
18: ................/virtual/main.c:1:30: error: expected expression
18: int failure(void *ctx) { if (); return 0; }
18: ^
18: 1 error generated.
18: ../virtual/main.c:3:73: error: too many arguments, bcc only supports in-register parameters
18: int many(struct pt_regs *ctx, int a, int b, int c, int d, int e, int f, int g) {
18: ^
18: 1 error generated.
18: ....
18: ----------------------------------------------------------------------
18: Ran 83 tests in 110.185s
18:
18: OK (skipped=1)
18: 0
18/47 Test #18: py_test_clang .................... Passed 110.46 sec
test 19
Start 19: py_test_histogram
19: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_histogram" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_histogram.py"
19: Test timeout computed to be: 10000000
19:
19: Bucket ptr = 'java'
19: value : count distribution
19: 0 -> 1 : 56 |********************|
19: 2 -> 3 : 0 | |
19: 4 -> 7 : 0 | |
19: 8 -> 15 : 0 | |
19: 16 -> 31 : 0 | |
19: 32 -> 63 : 0 | |
19: 64 -> 127 : 0 | |
19: 128 -> 255 : 0 | |
19: 256 -> 511 : 0 | |
19: 512 -> 1023 : 0 | |
19: 1024 -> 2047 : 0 | |
19: 2048 -> 4095 : 0 | |
19: 4096 -> 8191 : 0 | |
19: 8192 -> 16383 : 0 | |
19: 16384 -> 32767 : 0 | |
19: 32768 -> 65535 : 0 | |
19: 65536 -> 131071 : 0 | |
19: 131072 -> 262143 : 0 | |
19: 262144 -> 524287 : 0 | |
19: 524288 -> 1048575 : 0 | |
19: 1048576 -> 2097151 : 0 | |
19: 2097152 -> 4194303 : 0 | |
19: 4194304 -> 8388607 : 0 | |
19: 8388608 -> 16777215 : 0 | |
19: 16777216 -> 33554431 : 0 | |
19: 33554432 -> 67108863 : 0 | |
19: 67108864 -> 134217727 : 0 | |
19: 134217728 -> 268435455 : 0 | |
19: 268435456 -> 536870911 : 0 | |
19: 536870912 -> 1073741823 : 0 | |
19: 1073741824 -> 2147483647 : 0 | |
19: 2147483648 -> 4294967295 : 0 | |
19: 4294967296 -> 8589934591 : 0 | |
19: 8589934592 -> 17179869183 : 0 | |
19: 17179869184 -> 34359738367 : 0 | |
19: 34359738368 -> 68719476735 : 0 | |
19: 68719476736 -> 137438953471 : 0 | |
19: 137438953472 -> 274877906943 : 0 | |
19: 274877906944 -> 549755813887 : 0 | |
19: 549755813888 -> 1099511627775 : 2 | |
19:
19: Bucket ptr = 'python'
19: value : count distribution
19: 0 -> 1 : 0 | |
19: 2 -> 3 : 0 | |
19: 4 -> 7 : 0 | |
19: 8 -> 15 : 0 | |
19: 16 -> 31 : 0 | |
19: 32 -> 63 : 0 | |
19: 64 -> 127 : 0 | |
19: 128 -> 255 : 0 | |
19: 256 -> 511 : 0 | |
19: 512 -> 1023 : 0 | |
19: 1024 -> 2047 : 0 | |
19: 2048 -> 4095 : 0 | |
19: 4096 -> 8191 : 0 | |
19: 8192 -> 16383 : 0 | |
19: 16384 -> 32767 : 0 | |
19: 32768 -> 65535 : 0 | |
19: 65536 -> 131071 : 0 | |
19: 131072 -> 262143 : 0 | |
19: 262144 -> 524287 : 0 | |
19: 524288 -> 1048575 : 0 | |
19: 1048576 -> 2097151 : 0 | |
19: 2097152 -> 4194303 : 0 | |
19: 4194304 -> 8388607 : 0 | |
19: 8388608 -> 16777215 : 0 | |
19: 16777216 -> 33554431 : 0 | |
19: 33554432 -> 67108863 : 200 |********************|
19: 67108864 -> 134217727 : 0 | |
19: 134217728 -> 268435455 : 0 | |
19: 268435456 -> 536870911 : 0 | |
19: 536870912 -> 1073741823 : 0 | |
19: 1073741824 -> 2147483647 : 0 | |
19: 2147483648 -> 4294967295 : 0 | |
19: 4294967296 -> 8589934591 : 0 | |
19: 8589934592 -> 17179869183 : 0 | |
19: 17179869184 -> 34359738367 : 0 | |
19: 34359738368 -> 68719476735 : 0 | |
19: 68719476736 -> 137438953471 : 0 | |
19: 137438953472 -> 274877906943 : 0 | |
19: 274877906944 -> 549755813887 : 0 | |
19: 549755813888 -> 1099511627775 : 2 | |
19:
19: Bucket ptr = 'watchdog/0'
19: value : count distribution
19: 0 -> 1 : 2 |****************************************|
19:
19: Bucket ptr = 'watchdog/1'
19: value : count distribution
19: 0 -> 1 : 0 | |
19: 2 -> 3 : 0 | |
19: 4 -> 7 : 0 | |
19: 8 -> 15 : 0 | |
19: 16 -> 31 : 0 | |
19: 32 -> 63 : 0 | |
19: 64 -> 127 : 0 | |
19: 128 -> 255 : 0 | |
19: 256 -> 511 : 0 | |
19: 512 -> 1023 : 0 | |
19: 1024 -> 2047 : 0 | |
19: 2048 -> 4095 : 0 | |
19: 4096 -> 8191 : 0 | |
19: 8192 -> 16383 : 0 | |
19: 16384 -> 32767 : 0 | |
19: 32768 -> 65535 : 0 | |
19: 65536 -> 131071 : 0 | |
19: 131072 -> 262143 : 0 | |
19: 262144 -> 524287 : 0 | |
19: 524288 -> 1048575 : 0 | |
19: 1048576 -> 2097151 : 0 | |
19: 2097152 -> 4194303 : 0 | |
19: 4194304 -> 8388607 : 0 | |
19: 8388608 -> 16777215 : 0 | |
19: 16777216 -> 33554431 : 0 | |
19: 33554432 -> 67108863 : 2 |****************************************|
19:
19: Bucket ptr = 'kworker/1:8'
19: value : count distribution
19: 0 -> 1 : 0 | |
19: 2 -> 3 : 0 | |
19: 4 -> 7 : 0 | |
19: 8 -> 15 : 0 | |
19: 16 -> 31 : 0 | |
19: 32 -> 63 : 0 | |
19: 64 -> 127 : 0 | |
19: 128 -> 255 : 0 | |
19: 256 -> 511 : 0 | |
19: 512 -> 1023 : 0 | |
19: 1024 -> 2047 : 0 | |
19: 2048 -> 4095 : 0 | |
19: 4096 -> 8191 : 0 | |
19: 8192 -> 16383 : 0 | |
19: 16384 -> 32767 : 0 | |
19: 32768 -> 65535 : 0 | |
19: 65536 -> 131071 : 0 | |
19: 131072 -> 262143 : 0 | |
19: 262144 -> 524287 : 0 | |
19: 524288 -> 1048575 : 0 | |
19: 1048576 -> 2097151 : 0 | |
19: 2097152 -> 4194303 : 0 | |
19: 4194304 -> 8388607 : 0 | |
19: 8388608 -> 16777215 : 0 | |
19: 16777216 -> 33554431 : 0 | |
19: 33554432 -> 67108863 : 0 | |
19: 67108864 -> 134217727 : 0 | |
19: 134217728 -> 268435455 : 0 | |
19: 268435456 -> 536870911 : 0 | |
19: 536870912 -> 1073741823 : 0 | |
19: 1073741824 -> 2147483647 : 0 | |
19: 2147483648 -> 4294967295 : 0 | |
19: 4294967296 -> 8589934591 : 0 | |
19: 8589934592 -> 17179869183 : 0 | |
19: 17179869184 -> 34359738367 : 0 | |
19: 34359738368 -> 68719476735 : 0 | |
19: 68719476736 -> 137438953471 : 0 | |
19: 137438953472 -> 274877906943 : 0 | |
19: 274877906944 -> 549755813887 : 0 | |
19: 549755813888 -> 1099511627775 : 2 |********************|
19:
19: Bucket ptr = 'kworker/0:8'
19: value : count distribution
19: 0 -> 1 : 0 | |
19: 2 -> 3 : 0 | |
19: 4 -> 7 : 0 | |
19: 8 -> 15 : 0 | |
19: 16 -> 31 : 0 | |
19: 32 -> 63 : 0 | |
19: 64 -> 127 : 0 | |
19: 128 -> 255 : 0 | |
19: 256 -> 511 : 0 | |
19: 512 -> 1023 : 0 | |
19: 1024 -> 2047 : 0 | |
19: 2048 -> 4095 : 0 | |
19: 4096 -> 8191 : 0 | |
19: 8192 -> 16383 : 0 | |
19: 16384 -> 32767 : 0 | |
19: 32768 -> 65535 : 0 | |
19: 65536 -> 131071 : 0 | |
19: 131072 -> 262143 : 0 | |
19: 262144 -> 524287 : 0 | |
19: 524288 -> 1048575 : 0 | |
19: 1048576 -> 2097151 : 0 | |
19: 2097152 -> 4194303 : 0 | |
19: 4194304 -> 8388607 : 0 | |
19: 8388608 -> 16777215 : 0 | |
19: 16777216 -> 33554431 : 0 | |
19: 33554432 -> 67108863 : 0 | |
19: 67108864 -> 134217727 : 0 | |
19: 134217728 -> 268435455 : 0 | |
19: 268435456 -> 536870911 : 0 | |
19: 536870912 -> 1073741823 : 0 | |
19: 1073741824 -> 2147483647 : 0 | |
19: 2147483648 -> 4294967295 : 0 | |
19: 4294967296 -> 8589934591 : 0 | |
19: 8589934592 -> 17179869183 : 0 | |
19: 17179869184 -> 34359738367 : 0 | |
19: 34359738368 -> 68719476735 : 2 |********************|
19:
19: Bucket ptr = 'rcu_sched'
19: value : count distribution
19: 0 -> 1 : 6 |****************************************|
19:
19: Bucket ptr = 'swapper/0'
19: value : count distribution
19: 0 -> 1 : 0 | |
19: 2 -> 3 : 0 | |
19: 4 -> 7 : 0 | |
19: 8 -> 15 : 0 | |
19: 16 -> 31 : 0 | |
19: 32 -> 63 : 0 | |
19: 64 -> 127 : 0 | |
19: 128 -> 255 : 0 | |
19: 256 -> 511 : 0 | |
19: 512 -> 1023 : 0 | |
19: 1024 -> 2047 : 0 | |
19: 2048 -> 4095 : 0 | |
19: 4096 -> 8191 : 0 | |
19: 8192 -> 16383 : 0 | |
19: 16384 -> 32767 : 0 | |
19: 32768 -> 65535 : 0 | |
19: 65536 -> 131071 : 0 | |
19: 131072 -> 262143 : 0 | |
19: 262144 -> 524287 : 0 | |
19: 524288 -> 1048575 : 0 | |
19: 1048576 -> 2097151 : 0 | |
19: 2097152 -> 4194303 : 0 | |
19: 4194304 -> 8388607 : 0 | |
19: 8388608 -> 16777215 : 0 | |
19: 16777216 -> 33554431 : 6 |** |
19: 33554432 -> 67108863 : 2 | |
19: 67108864 -> 134217727 : 0 | |
19: 134217728 -> 268435455 : 0 | |
19: 268435456 -> 536870911 : 0 | |
19: 536870912 -> 1073741823 : 0 | |
19: 1073741824 -> 2147483647 : 0 | |
19: 2147483648 -> 4294967295 : 0 | |
19: 4294967296 -> 8589934591 : 0 | |
19: 8589934592 -> 17179869183 : 0 | |
19: 17179869184 -> 34359738367 : 0 | |
19: 34359738368 -> 68719476735 : 56 |********************|
19:
19: Bucket ptr = 'swapper/1'
19: value : count distribution
19: 0 -> 1 : 0 | |
19: 2 -> 3 : 0 | |
19: 4 -> 7 : 0 | |
19: 8 -> 15 : 0 | |
19: 16 -> 31 : 0 | |
19: 32 -> 63 : 0 | |
19: 64 -> 127 : 0 | |
19: 128 -> 255 : 0 | |
19: 256 -> 511 : 0 | |
19: 512 -> 1023 : 0 | |
19: 1024 -> 2047 : 0 | |
19: 2048 -> 4095 : 0 | |
19: 4096 -> 8191 : 0 | |
19: 8192 -> 16383 : 0 | |
19: 16384 -> 32767 : 0 | |
19: 32768 -> 65535 : 0 | |
19: 65536 -> 131071 : 0 | |
19: 131072 -> 262143 : 0 | |
19: 262144 -> 524287 : 0 | |
19: 524288 -> 1048575 : 0 | |
19: 1048576 -> 2097151 : 0 | |
19: 2097152 -> 4194303 : 0 | |
19: 4194304 -> 8388607 : 0 | |
19: 8388608 -> 16777215 : 0 | |
19: 16777216 -> 33554431 : 0 | |
19: 33554432 -> 67108863 : 2 | |
19: 67108864 -> 134217727 : 0 | |
19: 134217728 -> 268435455 : 0 | |
19: 268435456 -> 536870911 : 0 | |
19: ....
19: ----------------------------------------------------------------------
19: Ran 4 tests in 3.897s
19:
19: OK
19: 536870912 -> 1073741823 : 0 | |
19: 1073741824 -> 2147483647 : 0 | |
19: 2147483648 -> 4294967295 : 0 | |
19: 4294967296 -> 8589934591 : 0 | |
19: 8589934592 -> 17179869183 : 0 | |
19: 17179869184 -> 34359738367 : 0 | |
19: 34359738368 -> 68719476735 : 0 | |
19: 68719476736 -> 137438953471 : 0 | |
19: 137438953472 -> 274877906943 : 0 | |
19: 274877906944 -> 549755813887 : 0 | |
19: 549755813888 -> 1099511627775 : 200 |********************|
19/47 Test #19: py_test_histogram ................ Passed 3.98 sec
test 20
Start 20: py_array
20: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_array" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_array.py"
20: Test timeout computed to be: 10000000
20: ....
20: ----------------------------------------------------------------------
20: Ran 4 tests in 1.498s
20:
20: OK
20/47 Test #20: py_array ......................... Passed 1.58 sec
test 21
Start 21: py_uprobes
21: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_uprobes" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_uprobes.py"
21: Test timeout computed to be: 10000000
21: .Python 2.7.14
21: .Arena 0:
21: system bytes = 28139520
21: in use bytes = 3093168
21: Total (incl. mmap):
21: system bytes = 28930048
21: in use bytes = 3883696
21: max mmap regions = 7
21: max mmap bytes = 9203712
21: .
21: ----------------------------------------------------------------------
21: Ran 3 tests in 8.625s
21:
21: OK
21/47 Test #21: py_uprobes ....................... Passed 8.71 sec
test 22
Start 22: py_uprobes_2
22: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_uprobes2" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_uprobes2.py"
22: Test timeout computed to be: 10000000
22: .
22: ----------------------------------------------------------------------
22: Ran 1 test in 0.273s
22:
22: OK
22/47 Test #22: py_uprobes_2 ..................... Passed 0.37 sec
test 23
Start 23: py_test_stackid
23: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_stackid" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_stackid.py"
23: Test timeout computed to be: 10000000
23: s.
23: ----------------------------------------------------------------------
23: Ran 2 tests in 0.361s
23:
23: OK (skipped=1)
23/47 Test #23: py_test_stackid .................. Passed 0.48 sec
test 24
Start 24: py_test_tracepoint
24: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_test_tracepoint" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_tracepoint.py"
24: Test timeout computed to be: 10000000
24: ..
24: ----------------------------------------------------------------------
24: Ran 2 tests in 2.485s
24:
24: OK
24/47 Test #24: py_test_tracepoint ............... Passed 2.59 sec
test 25
Start 25: py_test_perf_event
25: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_test_perf_event" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_perf_event.py"
25: Test timeout computed to be: 10000000
25: perf_event_open: No such file or directory
25: s
25: ----------------------------------------------------------------------
25: Ran 1 test in 0.345s
25:
25: OK (skipped=1)
25/47 Test #25: py_test_perf_event ............... Passed 0.48 sec
test 26
Start 26: py_test_attach_perf_event
26: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_test_attach_perf_event" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_attach_perf_event.py"
26: Test timeout computed to be: 10000000
26: perf_event_open failed: No such file or directory
26: CRITICAL:root:WARNING! Test test_attach_raw_event_powerpc (__main__.TestPerfAttachRaw) failed, but marked as passed because it is decorated with @mayFail.
26: CRITICAL:root: The reason why this mayFail was: This fails on github actions environment, hw perf events are not supported
26: CRITICAL:root: The failure was: "None"
26: CRITICAL:root: Stacktrace: "Traceback (most recent call last):
26: File "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/utils.py", line 36, in wrapper
26: res = func(*args, **kwargs)
26: File "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_attach_perf_event.py", line 62, in test_attach_raw_event_powerpc
26: exit()
26: File "/usr/lib64/python2.7/site.py", line 355, in __call__
26: raise SystemExit(code)
26: SystemExit: None
26: "
26: .CRITICAL:root:WARNING! Test test_attach_raw_event_x86 (__main__.TestPerfAttachRaw) failed, but marked as passed because it is decorated with @mayFail.
26: CRITICAL:root: The reason why this mayFail was: This fails on github actions environment, hw perf events are not supported
26: CRITICAL:root: The failure was: "bpf_perf_event_data->addr requires kernel >= 4.17"
26: CRITICAL:root: Stacktrace: "Traceback (most recent call last):
26: File "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/utils.py", line 36, in wrapper
26: res = func(*args, **kwargs)
26: File "/usr/lib64/python2.7/unittest/case.py", line 63, in skip_wrapper
26: raise SkipTest(reason)
26: SkipTest: bpf_perf_event_data->addr requires kernel >= 4.17
26: "
26: .s
26: ----------------------------------------------------------------------
26: Ran 3 tests in 2.089s
26:
26: OK (skipped=1)
26: Failed to attach to a raw event. Please check the event attr used
26/47 Test #26: py_test_attach_perf_event ........ Passed 2.18 sec
test 27
Start 27: py_test_utils
27: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_test_utils" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_utils.py"
27: Test timeout computed to be: 10000000
27: ..
27: ----------------------------------------------------------------------
27: Ran 2 tests in 0.001s
27:
27: OK
27/47 Test #27: py_test_utils .................... Passed 0.08 sec
test 28
Start 28: py_test_percpu
28: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_test_percpu" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_percpu.py"
28: Test timeout computed to be: 10000000
28: ....
28: ----------------------------------------------------------------------
28: Ran 4 tests in 2.075s
28:
28: OK
28/47 Test #28: py_test_percpu ................... Passed 2.16 sec
test 29
Start 29: py_test_dump_func
29: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_dump_func" "simple" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_dump_func.py"
29: Test timeout computed to be: 10000000
29: .
29: ----------------------------------------------------------------------
29: Ran 1 test in 0.154s
29:
29: OK
29/47 Test #29: py_test_dump_func ................ Passed 0.21 sec
test 30
Start 30: py_test_disassembler
30: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_test_disassembler" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_disassembler.py"
30: Test timeout computed to be: 10000000
30: ..
30: ----------------------------------------------------------------------
30: Ran 2 tests in 0.245s
30:
30: OK
30/47 Test #30: py_test_disassembler ............. Passed 0.33 sec
test 31
Start 31: py_test_tools_smoke
31: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_test_tools_smoke" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_tools_smoke.py"
31: Test timeout computed to be: 10000000
31: Traceback (most recent call last):
31: File "../../tools/argdist.py", line 708, in run
31: self._main_loop()
31: File "../../tools/argdist.py", line 698, in _main_loop
31: exit()
31: File "/usr/lib64/python2.7/site.py", line 355, in __call__
31: raise SystemExit(code)
31: SystemExit: None
31: .....clear: terminal attributes: No such device or address
31:
31: .clear: terminal attributes: No such device or address
31:
31: clear: terminal attributes: No such device or address
31:
31: clear: terminal attributes: No such device or address
31:
31: .......s.............clear: terminal attributes: No such device or address
31:
31: ....../bin/sh: line 1: 6846 Killed timeout -s KILL -k 5s 5s ../../tools/killsnoop.py > /dev/null
31: .s..........libbpf: failed to find valid kernel BTF
31: libbpf: vmlinux BTF is not found
31: ......clear: terminal attributes: No such device or address
31:
31: ...............clear: terminal attributes: No such device or address
31:
31: ...clear: terminal attributes: No such device or address
31:
31: .....clear: terminal attributes: No such device or address
31:
31: ...libbpf: failed to find valid kernel BTF
31: libbpf: vmlinux BTF is not found
31: ......
31: ----------------------------------------------------------------------
31: Ran 83 tests in 272.677s
31:
31: OK (skipped=2)
31/47 Test #31: py_test_tools_smoke .............. Passed 272.74 sec
test 32
Start 32: py_test_tools_memleak
32: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_test_tools_memleak" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_tools_memleak.py"
32: Test timeout computed to be: 10000000
32: cannot attach uprobe, Device or resource busy
32: .cannot attach uprobe, Device or resource busy
32: .cannot attach uprobe, Device or resource busy
32: .cannot attach uprobe, Device or resource busy
32: .cannot attach uprobe, Device or resource busy
32: .cannot attach uprobe, Device or resource busy
32: .cannot attach uprobe, Device or resource busy
32: .cannot attach uprobe, Device or resource busy
32: .
32: ----------------------------------------------------------------------
32: Ran 8 tests in 22.246s
32:
32: OK
32/47 Test #32: py_test_tools_memleak ............ Passed 22.31 sec
test 33
Start 33: py_test_usdt
33: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_test_usdt" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_usdt.py"
33: Test timeout computed to be: 10000000
33: <stdin>:23:17: warning: null character(s) preserved in literal
33: <stdin>:28:17: warning: null character(s) preserved in literal
33: clang -cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -emit-llvm-uselists -disable-free -disable-llvm-verifier -discard-value-names -main-file-name main.c -mrelocation-model static -mthread-model posix -fno-jump-tables -fmath-errno -masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu x86-64 -momit-leaf-frame-pointer -dwarf-column-info -debugger-tuning=gdb -coverage-notes-file /usr/src/kernels/4.15.15-300.fc27.x86_64/main.gcno -nostdsysteminc -nobuiltininc -resource-dir lib64/clang/5.0.1 -isystem /virtual/lib/clang/include -include ./include/linux/kconfig.h -include /virtual/include/bcc/bpf.h -include /virtual/include/bcc/bpf_workaround.h -include /virtual/include/bcc/helpers.h -isystem /virtual/include -I /home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python -D __BPF_TRACING__ -I arch/x86/include/ -I /lib/modules/4.15.15-300.fc27.x86_64/build/arch/x86/include/generated -I include -I /lib/modules/4.15.15-300.fc27.x86_64/build/include -I arch/x86/include/uapi -I /lib/modules/4.15.15-300.fc27.x86_64/build/arch/x86/include/generated/uapi -I include/uapi -I /lib/modules/4.15.15-300.fc27.x86_64/build/include/generated/uapi -D __KERNEL__ -D KBUILD_MODNAME="bcc" -O2 -Wno-deprecated-declarations -Wno-gnu-variable-sized-type-not-at-end -Wno-pragma-once-outside-header -Wno-address-of-packed-member -Wno-unknown-warning-option -Wno-unused-value -Wno-pointer-sign -fdebug-compilation-dir /usr/src/kernels/4.15.15-300.fc27.x86_64 -ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc -fdiagnostics-show-option -vectorize-loops -vectorize-slp -o main.bc -x c /virtual/main.c
33: #if defined(BPF_LICENSE)
33: #error BPF_LICENSE cannot be specified through cflags
33: #endif
33: #if !defined(CONFIG_CC_STACKPROTECTOR)
33: #if defined(CONFIG_CC_STACKPROTECTOR_AUTO) \
33: || defined(CONFIG_CC_STACKPROTECTOR_REGULAR) \
33: || defined(CONFIG_CC_STACKPROTECTOR_STRONG)
33: #define CONFIG_CC_STACKPROTECTOR
33: #endif
33: #endif
33: #define bpf_probe_read_kernel bpf_probe_read
33: #define bpf_probe_read_kernel_str bpf_probe_read_str
33: #define bpf_probe_read_user bpf_probe_read
33: #define bpf_probe_read_user_str bpf_probe_read_str
33: #include <uapi/linux/ptrace.h>
33: __attribute__((always_inline))
33: static __always_inline int _bpf_readarg_do_trace1_1(struct pt_regs *ctx, void *dest, size_t len) {
33: if (len != sizeof(int8_t)) return -1;
33: switch(PT_REGS_IP(ctx)) {
33: case 0x400678ULL: *((int8_t *)dest) = ctx->ax; __asm__ __volatile__("": : :"memory"); return 0;
33: case 0x400681ULL: *((int8_t *)dest) = ctx->ax; __asm__ __volatile__("": : :"memory"); return 0;
33: }
33: return -1;
33: }
33: __attribute__((always_inline))
33: static __always_inline int _bpf_readarg_do_trace1_2(struct pt_regs *ctx, void *dest, size_t len) {
33: if (len != sizeof(int32_t)) return -1;
33: switch(PT_REGS_IP(ctx)) {
33: case 0x400678ULL: { u64 __addr = ctx->bp + -24; __asm__ __volatile__("": : :"memory"); int32_t __res = 0x0; bpf_probe_read_user(&__res, sizeof(__res), (void *)__addr); *((int32_t *)dest) = __res; } return 0;
33: case 0x400681ULL: { u64 __addr = ctx->bp + -20; __asm__ __volatile__("": : :"memory"); int32_t __res = 0x0; bpf_probe_read_user(&__res, sizeof(__res), (void *)__addr); *((int32_t *)dest) = __res; } return 0;
33: }
33: return -1;
33: }
33: __attribute__((always_inline))
33: static __always_inline int _bpf_readarg_do_trace3_1(struct pt_regs *ctx, void *dest, size_t len) {
33: if (len != sizeof(int32_t)) return -1;
33: switch(PT_REGS_IP(ctx)) {
33: case 0x400679ULL: { u64 __addr = ctx->bp + -20; __asm__ __volatile__("": : :"memory"); int32_t __res = 0x0; bpf_probe_read_user(&__res, sizeof(__res), (void *)__addr); *((int32_t *)dest) = __res; } return 0;
33: case 0x400698ULL: *((int32_t *)dest) = ctx->ax; __asm__ __volatile__("": : :"memory"); return 0;
33: }
33: return -1;
33: }
33: __attribute__((always_inline))
33: static __always_inline int _bpf_readarg_do_trace3_2(struct pt_regs *ctx, void *dest, size_t len) {
33: if (len != sizeof(int32_t)) return -1;
33: switch(PT_REGS_IP(ctx)) {
33: case 0x400679ULL: { u64 __addr = ctx->bp + -24; __asm__ __volatile__("": : :"memory"); int32_t __res = 0x0; bpf_probe_read_user(&__res, sizeof(__res), (void *)__addr); *((int32_t *)dest) = __res; } return 0;
33: case 0x400698ULL: *((int32_t *)dest) = ctx->dx; __asm__ __volatile__("": : :"memory"); return 0;
33: }
33: return -1;
33: }
33: __attribute__((always_inline))
33: static __always_inline int _bpf_readarg_do_trace2_1(struct pt_regs *ctx, void *dest, size_t len) {
33: if (len != sizeof(int32_t)) return -1;
33: *((int32_t *)dest) = 5;
33: return 0;
33: }
33: __attribute__((always_inline))
33: static __always_inline int _bpf_readarg_do_trace2_2(struct pt_regs *ctx, void *dest, size_t len) {
33: if (len != sizeof(int8_t)) return -1;
33: *((int8_t *)dest) = ctx->ax; __asm__ __volatile__("": : :"memory");
33: return 0;
33: }
33: __attribute__((always_inline))
33: static __always_inline int _bpf_readarg_do_trace4_1(struct pt_regs *ctx, void *dest, size_t len) {
33: if (len != sizeof(int64_t)) return -1;
33: *((int64_t *)dest) = ctx->ax; __asm__ __volatile__("": : :"memory");
33: return 0;
33: }
33: __attribute__((always_inline))
33: static __always_inline int _bpf_readarg_do_trace4_2(struct pt_regs *ctx, void *dest, size_t len) {
33: if (len != sizeof(int64_t)) return -1;
33: *((int64_t *)dest) = ctx->dx; __asm__ __volatile__("": : :"memory");
33: return 0;
33: }
33: __attribute__((always_inline))
33: static __always_inline int _bpf_readarg_do_trace5_1(struct pt_regs *ctx, void *dest, size_t len) {
33: if (len != sizeof(int64_t)) return -1;
33: *((int64_t *)dest) = ctx->dx; __asm__ __volatile__("": : :"memory");
33: return 0;
33: }
33: __attribute__((always_inline))
33: static __always_inline int _bpf_readarg_do_trace5_2(struct pt_regs *ctx, void *dest, size_t len) {
33: if (len != sizeof(int64_t)) return -1;
33: *((int64_t *)dest) = ctx->ax; __asm__ __volatile__("": : :"memory");
33: return 0;
33: }
33:
33: #include <linux/blkdev.h>
33: #include <uapi/linux/ptrace.h>
33:
33: struct probe_result_t1 {
33: char v1;
33: int v2;
33: };
33:
33: struct probe_result_t2 {
33: int v1;
33: char v2;
33: };
33:
33: struct probe_result_t3 {
33: int v1;
33: int v2;
33: };
33:
33: struct probe_result_t4 {
33: u64 v1;
33: char v2[8];
33: };
33:
33: struct probe_result_t5 {
33: char v1[8];
33: u64 v2;
33: };
33:
33: BPF_PERF_OUTPUT(event1);
33: BPF_PERF_OUTPUT(event2);
33: BPF_PERF_OUTPUT(event3);
33: BPF_PERF_OUTPUT(event4);
33: BPF_PERF_OUTPUT(event5);
33:
33: __attribute__((section(".bpf.fn.do_trace1")))
33: int do_trace1(struct pt_regs *ctx) {
33:
33: struct probe_result_t1 result = {};
33: _bpf_readarg_do_trace1_1(ctx, &result.v1, sizeof(*(&result.v1)));
33: _bpf_readarg_do_trace1_2(ctx, &result.v2, sizeof(*(&result.v2)));
33: bpf_perf_event_output(ctx, bpf_pseudo_fd(1, -1), CUR_CPU_IDENTIFIER, &result, sizeof(result));
33: return 0;
33: };
33: __attribute__((section(".bpf.fn.do_trace2")))
33: int do_trace2(struct pt_regs *ctx) {
33:
33: struct probe_result_t2 result = {};
33: _bpf_readarg_do_trace2_1(ctx, &result.v1, sizeof(*(&result.v1)));
33: _bpf_readarg_do_trace2_2(ctx, &result.v2, sizeof(*(&result.v2)));
33: bpf_perf_event_output(ctx, bpf_pseudo_fd(1, -2), CUR_CPU_IDENTIFIER, &result, sizeof(result));
33: return 0;
33: }
33: __attribute__((section(".bpf.fn.do_trace3")))
33: int do_trace3(struct pt_regs *ctx) {
33:
33: struct probe_result_t3 result = {};
33: _bpf_readarg_do_trace3_1(ctx, &result.v1, sizeof(*(&result.v1)));
33: _bpf_readarg_do_trace3_2(ctx, &result.v2, sizeof(*(&result.v2)));
33: bpf_perf_event_output(ctx, bpf_pseudo_fd(1, -3), CUR_CPU_IDENTIFIER, &result, sizeof(result));
33: return 0;
33: }
33: __attribute__((section(".bpf.fn.do_trace4")))
33: int do_trace4(struct pt_regs *ctx) {
33:
33: struct probe_result_t4 result = {};
33: _bpf_readarg_do_trace4_1(ctx, &result.v1, sizeof(*(&result.v1)));
33: ({ u64 __addr = 0x0; _bpf_readarg_do_trace4_2(ctx, &__addr, sizeof(__addr));bpf_probe_read(&result.v2, sizeof(result.v2), (void *)__addr);});
33: bpf_perf_event_output(ctx, bpf_pseudo_fd(1, -4), CUR_CPU_IDENTIFIER, &result, sizeof(result));
33: return 0;
33: }
33: __attribute__((section(".bpf.fn.do_trace5")))
33: int do_trace5(struct pt_regs *ctx) {
33:
33: struct probe_result_t5 result = {};
33: ({ u64 __addr = 0x0; _bpf_readarg_do_trace5_1(ctx, &__addr, sizeof(__addr));bpf_probe_read(&result.v1, sizeof(result.v1), (void *)__addr);});
33: _bpf_readarg_do_trace5_2(ctx, &result.v2, sizeof(*(&result.v2)));
33: bpf_perf_event_output(ctx, bpf_pseudo_fd(1, -5), CUR_CPU_IDENTIFIER, &result, sizeof(result));
33: return 0;
33: }
33:
33: #include <bcc/footer.h>
33: .
33: ----------------------------------------------------------------------
33: Ran 1 test in 3.054s
33:
33: OK
33: Running from kernel directory at: /lib/modules/4.15.15-300.fc27.x86_64/source
33: str4
33: str5
33: str6
33: str7
33/47 Test #33: py_test_usdt ..................... Passed 3.36 sec
test 34
Start 34: py_test_usdt2
34: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_test_usdt2" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_usdt2.py"
34: Test timeout computed to be: 10000000
34: .
34: ----------------------------------------------------------------------
34: Ran 1 test in 3.054s
34:
34: OK
34/47 Test #34: py_test_usdt2 .................... Passed 3.21 sec
test 35
Start 35: py_test_usdt3
35: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_test_usdt3" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_usdt3.py"
35: Test timeout computed to be: 10000000
35: test:probe [sema 0x0]
35: location #1 /proc/7097/root/tmp/tmpRm3_uZ/liba.so 0x5d1
35: argument #1 4 signed bytes @ *(bp - 4)
35: location #2 /proc/7097/root/tmp/tmpRm3_uZ/libb.so 0x5d1
35: argument #1 4 signed bytes @ *(bp - 4)
35: location #3 /proc/7097/root/tmp/tmpRm3_uZ/a.out 0x40064e
35: argument #1 4 signed bytes @ *(bp - 4)
35: test_dup_name:probe [sema 0x0]
35: location #1 /proc/7097/root/tmp/tmpRm3_uZ/liba.so 0x5d2
35: argument #1 4 signed bytes @ *(bp - 4)
35: location #2 /proc/7097/root/tmp/tmpRm3_uZ/libb.so 0x5d2
35: argument #1 4 signed bytes @ *(bp - 4)
35: location #3 /proc/7097/root/tmp/tmpRm3_uZ/a.out 0x40064f
35: argument #1 4 signed bytes @ *(bp - 4)
35: libc:setjmp [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x34321
35: argument #1 8 unsigned bytes @ di
35: argument #2 4 signed bytes @ si
35: argument #3 8 unsigned bytes @ ax
35: libc:longjmp [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x34403
35: argument #1 8 unsigned bytes @ di
35: argument #2 4 signed bytes @ si
35: argument #3 8 unsigned bytes @ dx
35: location #2 /proc/7097/root/usr/lib64/libc-2.26.so 0x106453
35: argument #1 8 unsigned bytes @ di
35: argument #2 4 signed bytes @ si
35: argument #3 8 unsigned bytes @ dx
35: libc:longjmp_target [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x3441f
35: argument #1 8 unsigned bytes @ di
35: argument #2 4 signed bytes @ ax
35: argument #3 8 unsigned bytes @ dx
35: location #2 /proc/7097/root/usr/lib64/libc-2.26.so 0x10646f
35: argument #1 8 unsigned bytes @ di
35: argument #2 4 signed bytes @ ax
35: argument #3 8 unsigned bytes @ dx
35: libc:memory_mallopt_arena_max [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x7ce73
35: argument #1 8 unsigned bytes @ ax
35: argument #2 8 unsigned bytes @ *(&mp_ + 32)
35: location #2 /proc/7097/root/usr/lib64/libc-2.26.so 0x83679
35: argument #1 8 unsigned bytes @ bx
35: argument #2 8 unsigned bytes @ *(&mp_ + 32)
35: libc:memory_mallopt_arena_test [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x7ce83
35: argument #1 8 unsigned bytes @ ax
35: argument #2 8 unsigned bytes @ *(&mp_ + 24)
35: location #2 /proc/7097/root/usr/lib64/libc-2.26.so 0x83691
35: argument #1 8 unsigned bytes @ bx
35: argument #2 8 unsigned bytes @ *(&mp_ + 24)
35: libc:memory_tunable_tcache_max_bytes [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x7ce9b
35: argument #1 8 unsigned bytes @ ax
35: argument #2 8 unsigned bytes @ *(&mp_ + 88)
35: libc:memory_tunable_tcache_count [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x7ced3
35: argument #1 8 unsigned bytes @ ax
35: argument #2 8 unsigned bytes @ *(&mp_ + 96)
35: libc:memory_tunable_tcache_unsorted_limit [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x7cee3
35: argument #1 8 unsigned bytes @ ax
35: argument #2 8 unsigned bytes @ *(&mp_ + 104)
35: libc:memory_mallopt_trim_threshold [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x7d283
35: argument #1 8 unsigned bytes @ ax
35: argument #2 8 unsigned bytes @ *(&mp_ + 0)
35: argument #3 4 signed bytes @ *(&mp_ + 52)
35: location #2 /proc/7097/root/usr/lib64/libc-2.26.so 0x83610
35: argument #1 8 unsigned bytes @ bx
35: argument #2 8 unsigned bytes @ *(&mp_ + 0)
35: argument #3 4 signed bytes @ *(&mp_ + 52)
35: libc:memory_mallopt_top_pad [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x7d2a3
35: argument #1 8 unsigned bytes @ ax
35: argument #2 8 unsigned bytes @ *(&mp_ + 8)
35: argument #3 4 signed bytes @ *(&mp_ + 52)
35: location #2 /proc/7097/root/usr/lib64/libc-2.26.so 0x83740
35: argument #1 8 unsigned bytes @ bx
35: argument #2 8 unsigned bytes @ *(&mp_ + 8)
35: argument #3 4 signed bytes @ *(&mp_ + 52)
35: libc:memory_mallopt_mmap_threshold [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x7d2cb
35: argument #1 8 unsigned bytes @ ax
35: argument #2 8 unsigned bytes @ *(&mp_ + 16)
35: argument #3 4 signed bytes @ *(&mp_ + 52)
35: location #2 /proc/7097/root/usr/lib64/libc-2.26.so 0x8371f
35: argument #1 8 unsigned bytes @ bx
35: argument #2 8 unsigned bytes @ *(&mp_ + 16)
35: argument #3 4 signed bytes @ *(&mp_ + 52)
35: libc:memory_mallopt_mmap_max [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x7d2e3
35: argument #1 4 signed bytes @ ax
35: argument #2 4 signed bytes @ *(&mp_ + 44)
35: argument #3 4 signed bytes @ *(&mp_ + 52)
35: location #2 /proc/7097/root/usr/lib64/libc-2.26.so 0x836f0
35: argument #1 4 signed bytes @ bx
35: argument #2 4 signed bytes @ *(&mp_ + 44)
35: argument #3 4 signed bytes @ *(&mp_ + 52)
35: libc:memory_mallopt_perturb [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x7d303
35: argument #1 4 signed bytes @ ax
35: argument #2 4 signed bytes @ *(&perturb_byte + 0)
35: location #2 /proc/7097/root/usr/lib64/libc-2.26.so 0x836a0
35: argument #1 4 signed bytes @ bx
35: argument #2 4 signed bytes @ *(&perturb_byte + 0)
35: libc:memory_arena_reuse_free_list [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x7d497
35: argument #1 8 unsigned bytes @ bx
35: libc:memory_heap_new [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x7d59e
35: argument #1 8 unsigned bytes @ bx
35: argument #2 8 unsigned bytes @ bp
35: libc:memory_arena_reuse [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x7e00e
35: argument #1 8 unsigned bytes @ bx
35: argument #2 8 unsigned bytes @ bp
35: libc:memory_arena_reuse_wait [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x7e08d
35: argument #1 8 unsigned bytes @ bx
35: argument #2 8 unsigned bytes @ bx
35: argument #3 8 unsigned bytes @ bp
35: libc:memory_arena_new [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x7e1e4
35: argument #1 8 unsigned bytes @ bx
35: argument #2 8 unsigned bytes @ r12
35: libc:memory_arena_retry [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x7e389
35: argument #1 8 unsigned bytes @ si
35: argument #2 8 unsigned bytes @ di
35: libc:memory_sbrk_less [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x7e98d
35: argument #1 8 unsigned bytes @ ax
35: argument #2 8 signed bytes @ bp
35: libc:memory_heap_free [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x7f100
35: argument #1 8 unsigned bytes @ di
35: argument #2 8 unsigned bytes @ ax
35: libc:memory_heap_less [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x7f45b
35: argument #1 8 unsigned bytes @ r12
35: argument #2 8 unsigned bytes @ r10
35: libc:memory_heap_more [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x7f725
35: argument #1 8 unsigned bytes @ r9
35: argument #2 8 unsigned bytes @ r8
35: libc:memory_sbrk_more [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x7f989
35: argument #1 8 unsigned bytes @ ax
35: argument #2 8 signed bytes @ r12
35: libc:memory_malloc_retry [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x82100
35: argument #1 8 unsigned bytes @ bx
35: libc:memory_memalign_retry [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x823f0
35: argument #1 8 unsigned bytes @ bp
35: argument #2 8 unsigned bytes @ bx
35: libc:memory_mallopt_free_dyn_thresholds [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x82542
35: argument #1 8 unsigned bytes @ ax
35: argument #2 8 unsigned bytes @ dx
35: libc:memory_realloc_retry [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x82965
35: argument #1 8 unsigned bytes @ bp
35: argument #2 8 unsigned bytes @ bx
35: libc:memory_calloc_retry [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x82e08
35: argument #1 8 unsigned bytes @ bp
35: libc:memory_mallopt [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x835e0
35: argument #1 4 signed bytes @ bp
35: argument #2 4 signed bytes @ bx
35: libc:memory_mallopt_mxfast [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x836c6
35: argument #1 4 signed bytes @ bx
35: argument #2 8 unsigned bytes @ *(&global_max_fast + 0)
35: libc:lll_lock_wait_private [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/libc-2.26.so 0x1021d4
35: argument #1 8 unsigned bytes @ di
35: rtld:init_start [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/ld-2.26.so 0x3993
35: argument #1 4 signed bytes @ 0
35: argument #2 8 unsigned bytes @ bx
35: rtld:init_complete [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/ld-2.26.so 0x4071
35: argument #1 4 signed bytes @ 0
35: argument #2 8 unsigned bytes @ bx
35: rtld:map_failed [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/ld-2.26.so 0x55a6
35: argument #1 8 signed bytes @ *(sp + 72)
35: argument #2 8 unsigned bytes @ bp
35: rtld:map_start [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/ld-2.26.so 0x5a5a
35: argument #1 8 signed bytes @ *(bp + 40)
35: argument #2 8 unsigned bytes @ bx
35: rtld:map_complete [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/ld-2.26.so 0x1384c
35: argument #1 8 signed bytes @ *(r15 + 40)
35: argument #2 8 unsigned bytes @ bx
35: argument #3 8 unsigned bytes @ r14
35: rtld:reloc_start [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/ld-2.26.so 0x1390b
35: argument #1 8 signed bytes @ *(ax + 40)
35: argument #2 8 unsigned bytes @ *(bp - 120)
35: rtld:reloc_complete [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/ld-2.26.so 0x13dcf
35: argument #1 8 signed bytes @ *(ax + 40)
35: argument #2 8 unsigned bytes @ *(bp - 120)
35: argument #3 8 unsigned bytes @ r14
35: rtld:unmap_start [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/ld-2.26.so 0x14a64
35: argument #1 8 signed bytes @ r14
35: argument #2 8 unsigned bytes @ bx
35: rtld:unmap_complete [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/ld-2.26.so 0x14d04
35: argument #1 8 signed bytes @ *(bp - 128)
35: argument #2 8 unsigned bytes @ bx
35: rtld:setjmp [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/ld-2.26.so 0x1a9fd
35: argument #1 8 unsigned bytes @ di
35: argument #2 4 signed bytes @ si
35: argument #3 8 unsigned bytes @ ax
35: rtld:longjmp [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/ld-2.26.so 0x1aa3d
35: argument #1 8 unsigned bytes @ di
35: argument #2 4 signed bytes @ si
35: argument #3 8 unsigned bytes @ dx
35: rtld:longjmp_target [sema 0x0]
35: location #1 /proc/7097/root/usr/lib64/ld-2.26.so 0x1aa59
35: argument #1 8 unsigned bytes @ di
35: argument #2 4 signed bytes @ ax
35: argument #3 8 unsigned bytes @ dx
35: .
35: ----------------------------------------------------------------------
35: Ran 1 test in 1.140s
35:
35: OK
35: temp directory: /tmp/tmpRm3_uZ
35/47 Test #35: py_test_usdt3 .................... Passed 1.28 sec
test 36
Start 36: py_test_license
36: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_test_license" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_license.py"
36: Test timeout computed to be: 10000000
36: /virtual/main.c:2:2: error: BPF_LICENSE cannot be specified through cflags
36: #error BPF_LICENSE cannot be specified through cflags
36: ^
36: 1 error generated.
36: x/virtual/main.c:2:2: error: BPF_LICENSE cannot be specified through cflags
36: #error BPF_LICENSE cannot be specified through cflags
36: ^
36: 1 error generated.
36: x.bpf: Failed to load program: Invalid argument
36: 0: (bf) r6 = r1
36: 1: (85) call bpf_ktime_get_ns#5
36: cannot call GPL only function from proprietary program
36:
36: x../virtual/main.c:2:2: error: BPF_LICENSE cannot be specified through cflags
36: #error BPF_LICENSE cannot be specified through cflags
36: ^
36: 1 error generated.
36: xbpf: Failed to load program: Invalid argument
36: 0: (bf) r6 = r1
36: 1: (85) call bpf_ktime_get_ns#5
36: cannot call GPL only function from proprietary program
36:
36: x..
36: ----------------------------------------------------------------------
36: Ran 10 tests in 2.835s
36:
36: OK (expected failures=5)
36/47 Test #36: py_test_license .................. Passed 2.91 sec
test 37
Start 37: py_test_free_bcc_memory
37: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_test_free_bcc_memory" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_free_bcc_memory.py"
37: Test timeout computed to be: 10000000
37: .
37: ----------------------------------------------------------------------
37: Ran 1 test in 0.255s
37:
37: OK
37: Before freeing llvm memory: RssFile: 67868 kB
37: After freeing llvm memory: RssFile: 49404 kB
37/47 Test #37: py_test_free_bcc_memory .......... Passed 0.35 sec
test 38
Start 38: py_test_rlimit
38: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_test_rlimit" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_rlimit.py"
38: Test timeout computed to be: 10000000
38: could not open bpf map: unused, error: Operation not permitted
38: .
38: ----------------------------------------------------------------------
38: Ran 1 test in 0.466s
38:
38: OK
38/47 Test #38: py_test_rlimit ................... Passed 0.54 sec
test 39
Start 39: py_test_lpm_trie
39: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_test_lpm_trie" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_lpm_trie.py"
39: Test timeout computed to be: 10000000
39: ..
39: ----------------------------------------------------------------------
39: Ran 2 tests in 0.483s
39:
39: OK
39/47 Test #39: py_test_lpm_trie ................. Passed 0.58 sec
test 40
Start 40: py_ringbuf
40: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_ringbuf" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_ringbuf.py"
40: Test timeout computed to be: 10000000
40: ssss
40: ----------------------------------------------------------------------
40: Ran 4 tests in 0.000s
40:
40: OK (skipped=4)
40/47 Test #40: py_ringbuf ....................... Passed 0.10 sec
test 41
Start 41: py_queuestack
41: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_queuestack" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_queuestack.py"
41: Test timeout computed to be: 10000000
41: ss
41: ----------------------------------------------------------------------
41: Ran 2 tests in 0.000s
41:
41: OK (skipped=2)
41/47 Test #41: py_queuestack .................... Passed 0.09 sec
test 42
Start 42: py_test_map_batch_ops
42: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_test_map_batch_ops" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_map_batch_ops.py"
42: Test timeout computed to be: 10000000
42: ssssss
42: ----------------------------------------------------------------------
42: Ran 6 tests in 0.000s
42:
42: OK (skipped=6)
42/47 Test #42: py_test_map_batch_ops ............ Passed 0.09 sec
test 43
Start 43: py_test_map_in_map
43: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "py_test_map_in_map" "sudo" "/home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/python/test_map_in_map.py"
43: Test timeout computed to be: 10000000
43: ...
43: ----------------------------------------------------------------------
43: Ran 3 tests in 0.907s
43:
43: OK
43/47 Test #43: py_test_map_in_map ............... Passed 1.00 sec
test 44
Start 44: lua_test_clang
44: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "lua_test_clang" "sudo" "/usr/bin/luajit" "test_clang.lua"
44: Test timeout computed to be: 10000000
44: /virtual/main.c:1:30: error: expected expression
44: int failure(void *ctx) { if (); return 0; }
44: ^
44: 1 error generated.
44: ....................
44: Ran 20 tests in 17.563 seconds, 20 successes, 0 failures
44: OK
44/47 Test #44: lua_test_clang ................... Passed 17.82 sec
test 45
Start 45: lua_test_uprobes
45: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "lua_test_uprobes" "sudo" "/usr/bin/luajit" "test_uprobes.lua"
45: Test timeout computed to be: 10000000
45: Python 2.7.14
45: Arena 0:
45: system bytes = 23629824
45: in use bytes = 1231632
45: Total (incl. mmap):
45: system bytes = 23629824
45: in use bytes = 1231632
45: max mmap regions = 6
45: max mmap bytes = 8413184
45: ..
45: Ran 2 tests in 0.554 seconds, 2 successes, 0 failures
45: OK
45/47 Test #45: lua_test_uprobes ................. Passed 0.66 sec
test 46
Start 46: lua_test_dump
46: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/build/tests/wrapper.sh "lua_test_dump" "sudo" "/usr/bin/luajit" "test_dump.lua"
46: Test timeout computed to be: 10000000
46: .
46: Ran 1 tests in 0.236 seconds, 1 successes, 0 failures
46: OK
46/47 Test #46: lua_test_dump .................... Passed 0.28 sec
test 47
Start 47: lua_test_standalone
47: Test command: /home/fedora/jenkins/workspace/bcc-pr/label/fc27/tests/lua/test_standalone.sh
47: Test timeout computed to be: 10000000
47: + cd src/lua
47: + [[ ! -x bcc-lua ]]
47: + echo 'bcc-lua not built --- skipping'
47: bcc-lua not built --- skipping
47: + exit 0
47/47 Test #47: lua_test_standalone .............. Passed 0.00 sec
100% tests passed, 0 tests failed out of 47
Total Test time (real) = 515.75 sec
++ head -n 1 Testing/TAG
+ cp Testing/20210906-0307/Test.xml ./CTestResults.xml
Taking single-use agent fedora27-slave-b52 offline.
Finished: SUCCESS