]> granicus.if.org Git - strace/blobdiff - perf.c
nlattr: add UID/GID netlink attribute decoders
[strace] / perf.c
diff --git a/perf.c b/perf.c
index 6af0f42a1b09610164f86998602cb9401ee1c4cd..e66ca4d7c95f0eb5f6467c039eb56905a0bd9a23 100644 (file)
--- a/perf.c
+++ b/perf.c
@@ -2,7 +2,7 @@
  * Copyright (c) 2013 Ben Noordhuis <info@bnoordhuis.nl>
  * Copyright (c) 2013-2015 Dmitry V. Levin <ldv@altlinux.org>
  * Copyright (c) 2016 Eugene Syromyatnikov <evgsyr@gmail.com>
- * Copyright (c) 2015-2017 The strace developers.
+ * Copyright (c) 2015-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -60,7 +60,7 @@ free_pea_desc(void *pea_desc_ptr)
        free(desc);
 }
 
-static int
+int
 fetch_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
 {
        struct pea_desc *desc;
@@ -117,7 +117,7 @@ fetch_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
                printxval_search(xlat, x, dflt); \
        } while (0)
 
-static void
+void
 print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
 {
        static const char *precise_ip_desc[] = {
@@ -304,7 +304,8 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
                ", comm_exec=%u"
                ", use_clockid=%u"
                ", context_switch=%u"
-               ", write_backward=%u",
+               ", write_backward=%u"
+               ", namespaces=%u",
                attr->mmap_data,
                attr->sample_id_all,
                attr->exclude_host,
@@ -315,7 +316,8 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
                attr->comm_exec,
                attr->use_clockid,
                attr->context_switch,
-               attr->write_backward);
+               attr->write_backward,
+               attr->namespaces);
 
        /*
         * Print it only in case it is non-zero, since it may contain flags we
@@ -324,7 +326,7 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
        if (attr->__reserved_1) {
                tprintf(", __reserved_1=%#" PRIx64,
                        (uint64_t) attr->__reserved_1);
-               tprints_comment("Bits 63..28");
+               tprints_comment("Bits 63..29");
        }
 
        if (attr->watermark)
@@ -422,10 +424,11 @@ SYS_FUNC(perf_event_open)
                print_perf_event_attr(tcp, tcp->u_arg[0]);
        }
 
-       tprintf(", %d, %d, %d, ",
+       tprintf(", %d, %d, ",
                (int) tcp->u_arg[1],
-               (int) tcp->u_arg[2],
-               (int) tcp->u_arg[3]);
+               (int) tcp->u_arg[2]);
+       printfd(tcp, tcp->u_arg[3]);
+       tprints(", ");
        printflags64(perf_event_open_flags, tcp->u_arg[4], "PERF_FLAG_???");
 
        return RVAL_DECODED | RVAL_FD;