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

Commit 79b0691d authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull perf fixes from Ingo Molnar:
 "Tooling fixes plus a handful of late arriving tooling changes"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf tools: Fix link time error with sample_reg_masks on non x86
  perf build: Fix Intel PT instruction decoder dependency problem
  perf dwarf: Fix potential array out of bounds access
  perf record: Add ability to name registers to record
  perf/x86: Add list of register names
  perf script: Enable printing of interrupted machine state
  perf evlist: Open event on evsel cpus and threads
  bpf tools: New API to get name from a BPF object
  perf tools: Fix build on powerpc broken by pt/bts
parents ca520cab 5b923564
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 −1
Original line number Original line Diff line number Diff line
@@ -51,5 +51,5 @@ const char *sh_regs_table[SH_MAX_REGS] = {
/* Return architecture dependent register string (for kprobe-tracer) */
/* Return architecture dependent register string (for kprobe-tracer) */
const char *get_arch_regstr(unsigned int n)
const char *get_arch_regstr(unsigned int n)
{
{
	return (n <= SH_MAX_REGS) ? sh_regs_table[n] : NULL;
	return (n < SH_MAX_REGS) ? sh_regs_table[n] : NULL;
}
}
Loading