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

Commit 3e7e09db 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/core

Pull perf/core updates from Arnaldo Carvalho de Melo:

Changes in user visible interfaces:

  * Rename 'record's --no-delay option to --no-buffering, better reflecting its
    purpose and freeing up '--delay' to take the place of '--initial-delay', so that
    'record' and 'stat' are consistent.

Refactorings:

  * Get rid of die() and friends (good riddance!) in libtraceevent (Namhyung Kim)

Infrastructure enhancements:

  * Fix cross build problems related to pkgconfig and CROSS_COMPILE not being
    propagated to the feature tests, leading to features being tested in the
    host and then being enabled on the target. (Mark Rutland)

  * Fix pointer-integer size mismatch in some libtraceevent plugins (Mark Rutland)

  * Fix build error due to zfree() cast (Namhyung Kim)

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 860fc2f2 0e9e79a1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -136,7 +136,7 @@ export Q VERBOSE

EVENT_PARSE_VERSION = $(EP_VERSION).$(EP_PATCHLEVEL).$(EP_EXTRAVERSION)

INCLUDES = -I. $(CONFIG_INCLUDES)
INCLUDES = -I. -I $(srctree)/../../include $(CONFIG_INCLUDES)

# Set compile option CFLAGS if not set elsewhere
CFLAGS ?= -g -Wall
+11 −3
Original line number Diff line number Diff line
@@ -58,6 +58,12 @@ struct pevent_record {
#endif
};

enum trace_seq_fail {
	TRACE_SEQ__GOOD,
	TRACE_SEQ__BUFFER_POISONED,
	TRACE_SEQ__MEM_ALLOC_FAILED,
};

/*
 * Trace sequences are used to allow a function to call several other functions
 * to create a string of data to use (up to a max of PAGE_SIZE).
@@ -68,6 +74,7 @@ struct trace_seq {
	unsigned int		buffer_size;
	unsigned int		len;
	unsigned int		readpos;
	enum trace_seq_fail	state;
};

void trace_seq_init(struct trace_seq *s);
@@ -98,7 +105,7 @@ typedef int (*pevent_event_handler_func)(struct trace_seq *s,
					 void *context);

typedef int (*pevent_plugin_load_func)(struct pevent *pevent);
typedef int (*pevent_plugin_unload_func)(void);
typedef int (*pevent_plugin_unload_func)(struct pevent *pevent);

struct plugin_option {
	struct plugin_option		*next;
@@ -123,7 +130,7 @@ struct plugin_option {
 * PEVENT_PLUGIN_UNLOADER:  (optional)
 *   The function called just before unloading
 *
 *   int PEVENT_PLUGIN_UNLOADER(void)
 *   int PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
 *
 * PEVENT_PLUGIN_OPTIONS:  (optional)
 *   Plugin options that can be set before loading
@@ -404,7 +411,8 @@ enum pevent_errno {
struct plugin_list;

struct plugin_list *traceevent_load_plugins(struct pevent *pevent);
void traceevent_unload_plugins(struct plugin_list *plugin_list);
void traceevent_unload_plugins(struct plugin_list *plugin_list,
			       struct pevent *pevent);

struct cmdline;
struct cmdline_list;
+2 −2
Original line number Diff line number Diff line
@@ -197,7 +197,7 @@ traceevent_load_plugins(struct pevent *pevent)
}

void
traceevent_unload_plugins(struct plugin_list *plugin_list)
traceevent_unload_plugins(struct plugin_list *plugin_list, struct pevent *pevent)
{
	pevent_plugin_unload_func func;
	struct plugin_list *list;
@@ -207,7 +207,7 @@ traceevent_unload_plugins(struct plugin_list *plugin_list)
		plugin_list = list->next;
		func = dlsym(list->handle, PEVENT_PLUGIN_UNLOADER_NAME);
		if (func)
			func();
			func(pevent);
		dlclose(list->handle);
		free(list->name);
		free(list);
+0 −4
Original line number Diff line number Diff line
@@ -23,18 +23,14 @@
#include <ctype.h>

/* Can be overridden */
void die(const char *fmt, ...);
void *malloc_or_die(unsigned int size);
void warning(const char *fmt, ...);
void pr_stat(const char *fmt, ...);
void vpr_stat(const char *fmt, va_list ap);

/* Always available */
void __die(const char *fmt, ...);
void __warning(const char *fmt, ...);
void __pr_stat(const char *fmt, ...);

void __vdie(const char *fmt, ...);
void __vwarning(const char *fmt, ...);
void __vpr_stat(const char *fmt, ...);

+0 −44
Original line number Diff line number Diff line
@@ -25,40 +25,6 @@

#define __weak __attribute__((weak))

void __vdie(const char *fmt, va_list ap)
{
	int ret = errno;

	if (errno)
		perror("trace-cmd");
	else
		ret = -1;

	fprintf(stderr, "  ");
	vfprintf(stderr, fmt, ap);

	fprintf(stderr, "\n");
	exit(ret);
}

void __die(const char *fmt, ...)
{
	va_list ap;

	va_start(ap, fmt);
	__vdie(fmt, ap);
	va_end(ap);
}

void __weak die(const char *fmt, ...)
{
	va_list ap;

	va_start(ap, fmt);
	__vdie(fmt, ap);
	va_end(ap);
}

void __vwarning(const char *fmt, va_list ap)
{
	if (errno)
@@ -117,13 +83,3 @@ void __weak pr_stat(const char *fmt, ...)
	__vpr_stat(fmt, ap);
	va_end(ap);
}

void __weak *malloc_or_die(unsigned int size)
{
	void *data;

	data = malloc(size);
	if (!data)
		die("malloc");
	return data;
}
Loading