Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53202661 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge tag 'perf-core-for-mingo' of...

Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux

 into perf/urgent

Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:

User visible changes:

  - Add ability to specify to select which registers to record,
    to reduce the size of perf.data files, and also allow printing
    the registers in 'perf script': (Stephane Eranian)

      # perf record --intr-regs=AX,SP usleep 1
      [ perf record: Woken up 1 times to write data ]
      [ perf record: Captured and wrote 0.016 MB perf.data (8 samples) ]
      # perf script -F ip,sym,iregs | tail -5
       ffffffff8105f42a native_write_msr_safe   AX:0xf    SP:0xffff8802629c3c00
       ffffffff8105f42a native_write_msr_safe   AX:0xf    SP:0xffff8802629c3c00
       ffffffff81761ac0 _raw_spin_lock   AX:0xffff8801bfcf8020    SP:0xffff8802629c3ce8
       ffffffff81202bf8 __vma_adjust_trans_huge   AX:0x7ffc75200000    SP:0xffff8802629c3b30
       ffffffff8122b089 dput   AX:0x101    SP:0xffff8802629c3c78
      #

Infrastructure changes:

  - Open event on evsel cpus and threads. (Kan Liang)

  - Add new bpf API to get name from a BPF object. (Wang Nan)

Build fixes:

  - Fix build on powerpc broken by pt/bts. (Adrian Hunter)

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 65a99597 bcc84ec6
Loading
Loading
Loading
Loading
+22 −3
Original line number Original line Diff line number Diff line
@@ -880,15 +880,26 @@ struct bpf_object *bpf_object__open(const char *path)
}
}


struct bpf_object *bpf_object__open_buffer(void *obj_buf,
struct bpf_object *bpf_object__open_buffer(void *obj_buf,
					   size_t obj_buf_sz)
					   size_t obj_buf_sz,
					   const char *name)
{
{
	char tmp_name[64];

	/* param validation */
	/* param validation */
	if (!obj_buf || obj_buf_sz <= 0)
	if (!obj_buf || obj_buf_sz <= 0)
		return NULL;
		return NULL;


	pr_debug("loading object from buffer\n");
	if (!name) {
		snprintf(tmp_name, sizeof(tmp_name), "%lx-%lx",
			 (unsigned long)obj_buf,
			 (unsigned long)obj_buf_sz);
		tmp_name[sizeof(tmp_name) - 1] = '\0';
		name = tmp_name;
	}
	pr_debug("loading object '%s' from buffer\n",
		 name);


	return __bpf_object__open("[buffer]", obj_buf, obj_buf_sz);
	return __bpf_object__open(name, obj_buf, obj_buf_sz);
}
}


int bpf_object__unload(struct bpf_object *obj)
int bpf_object__unload(struct bpf_object *obj)
@@ -975,6 +986,14 @@ bpf_object__next(struct bpf_object *prev)
	return next;
	return next;
}
}


const char *
bpf_object__get_name(struct bpf_object *obj)
{
	if (!obj)
		return NULL;
	return obj->path;
}

struct bpf_program *
struct bpf_program *
bpf_program__next(struct bpf_program *prev, struct bpf_object *obj)
bpf_program__next(struct bpf_program *prev, struct bpf_object *obj)
{
{
+3 −1
Original line number Original line Diff line number Diff line
@@ -28,12 +28,14 @@ struct bpf_object;


struct bpf_object *bpf_object__open(const char *path);
struct bpf_object *bpf_object__open(const char *path);
struct bpf_object *bpf_object__open_buffer(void *obj_buf,
struct bpf_object *bpf_object__open_buffer(void *obj_buf,
					   size_t obj_buf_sz);
					   size_t obj_buf_sz,
					   const char *name);
void bpf_object__close(struct bpf_object *object);
void bpf_object__close(struct bpf_object *object);


/* Load/unload object into/from kernel */
/* Load/unload object into/from kernel */
int bpf_object__load(struct bpf_object *obj);
int bpf_object__load(struct bpf_object *obj);
int bpf_object__unload(struct bpf_object *obj);
int bpf_object__unload(struct bpf_object *obj);
const char *bpf_object__get_name(struct bpf_object *obj);


struct bpf_object *bpf_object__next(struct bpf_object *prev);
struct bpf_object *bpf_object__next(struct bpf_object *prev);
#define bpf_object__for_each_safe(pos, tmp)			\
#define bpf_object__for_each_safe(pos, tmp)			\
+5 −1
Original line number Original line Diff line number Diff line
@@ -276,7 +276,11 @@ filter out the startup phase of the program, which is often very different.
--intr-regs::
--intr-regs::
Capture machine state (registers) at interrupt, i.e., on counter overflows for
Capture machine state (registers) at interrupt, i.e., on counter overflows for
each sample. List of captured registers depends on the architecture. This option
each sample. List of captured registers depends on the architecture. This option
is off by default.
is off by default. It is possible to select the registers to sample using their
symbolic names, e.g. on x86, ax, si. To list the available registers use
--intr-regs=\?. To name registers, pass a comma separated list such as
--intr-regs=ax,bx. The list of register is architecture dependent.



--running-time::
--running-time::
Record running and enabled time for read events (:S)
Record running and enabled time for read events (:S)
+1 −1
Original line number Original line Diff line number Diff line
@@ -116,7 +116,7 @@ OPTIONS
--fields::
--fields::
        Comma separated list of fields to print. Options are:
        Comma separated list of fields to print. Options are:
        comm, tid, pid, time, cpu, event, trace, ip, sym, dso, addr, symoff,
        comm, tid, pid, time, cpu, event, trace, ip, sym, dso, addr, symoff,
	srcline, period, flags.
	srcline, period, iregs, flags.
        Field list can be prepended with the type, trace, sw or hw,
        Field list can be prepended with the type, trace, sw or hw,
        to indicate to which event type the field list applies.
        to indicate to which event type the field list applies.
        e.g., -f sw:comm,tid,time,ip,sym  and -f trace:time,cpu,trace
        e.g., -f sw:comm,tid,time,ip,sym  and -f trace:time,cpu,trace
+1 −0
Original line number Original line Diff line number Diff line
@@ -2,6 +2,7 @@ libperf-y += header.o
libperf-y += tsc.o
libperf-y += tsc.o
libperf-y += pmu.o
libperf-y += pmu.o
libperf-y += kvm-stat.o
libperf-y += kvm-stat.o
libperf-y += perf_regs.o


libperf-$(CONFIG_DWARF) += dwarf-regs.o
libperf-$(CONFIG_DWARF) += dwarf-regs.o


Loading