Commit 53f3feeb authored by Ingo Molnar's avatar Ingo Molnar
Browse files

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

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

 into perf/core

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

perf record:

  Alexey Budankov:

  - Adapt affinity for machines with #CPUs > 1K to overcome current 1024 CPUs
    mask size limitation of cpu_set_t type.

perf report/top TUI:

  Arnaldo Carvalho de Melo:

  - Make ENTER consistently present the pop up menu with and without call
    chains, to eliminate confusion. The menu continues available at all times
    use 'm' and '+' can be used to toggle just one call chain level, 'e' for all
    the call chains for a top level histogram entry and 'E' to expand all call
    chains in all top level entries. Extra info about these options was added to
    the pop up menu entries. Pressing 'k' serves as special hotkey to go straight
    to the main vmlinux entries, to avoid having to press enter and then select
    "Zoom into the kernel DSO".

perf sched timehist:

  David Ahern:

  - Add support for filtering on CPU.

perf tests:

  Arnaldo Carvalho de Melo:

  - Show expected versus obtained values in bp_signal test.

libperf:

  Jiri Olsa:

  - Move to tools/lib/perf.

  - Add man pages.

libapi:

  Andrey Zhizhikin:

  - Fix gcc9 stringop-truncation compilation error.

tools lib:

  Vitaly Chikunov:

  - Fix builds when glibc contains strlcpy(), which is the case for ALT Linux.

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 1f676247 6c4798d3
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@ void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1,
		 const unsigned long *bitmap2, int bits);
int __bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
		 const unsigned long *bitmap2, unsigned int bits);
int __bitmap_equal(const unsigned long *bitmap1,
		   const unsigned long *bitmap2, unsigned int bits);
void bitmap_clear(unsigned long *map, unsigned int start, int len);

#define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) & (BITS_PER_LONG - 1)))
@@ -123,6 +125,15 @@ static inline unsigned long *bitmap_alloc(int nbits)
	return calloc(1, BITS_TO_LONGS(nbits) * sizeof(unsigned long));
}

/*
 * bitmap_free - Free bitmap
 * @bitmap: pointer to bitmap
 */
static inline void bitmap_free(unsigned long *bitmap)
{
	free(bitmap);
}

/*
 * bitmap_scnprintf - print bitmap list into buffer
 * @bitmap: bitmap
@@ -148,4 +159,23 @@ static inline int bitmap_and(unsigned long *dst, const unsigned long *src1,
	return __bitmap_and(dst, src1, src2, nbits);
}

#ifdef __LITTLE_ENDIAN
#define BITMAP_MEM_ALIGNMENT 8
#else
#define BITMAP_MEM_ALIGNMENT (8 * sizeof(unsigned long))
#endif
#define BITMAP_MEM_MASK (BITMAP_MEM_ALIGNMENT - 1)
#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)

static inline int bitmap_equal(const unsigned long *src1,
			const unsigned long *src2, unsigned int nbits)
{
	if (small_const_nbits(nbits))
		return !((*src1 ^ *src2) & BITMAP_LAST_WORD_MASK(nbits));
	if (__builtin_constant_p(nbits & BITMAP_MEM_MASK) &&
	    IS_ALIGNED(nbits, BITMAP_MEM_ALIGNMENT))
		return !memcmp(src1, src2, nbits / 8);
	return __bitmap_equal(src1, src2, nbits);
}

#endif /* _PERF_BITOPS_H */
+8 −0
Original line number Diff line number Diff line
@@ -17,7 +17,15 @@ int strtobool(const char *s, bool *res);
 * However uClibc headers also define __GLIBC__ hence the hack below
 */
#if defined(__GLIBC__) && !defined(__UCLIBC__)
// pragma diagnostic was introduced in gcc 4.6
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wredundant-decls"
#endif
extern size_t strlcpy(char *dest, const char *src, size_t size);
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
#pragma GCC diagnostic pop
#endif
#endif

char *str_error_r(int errnum, char *buf, size_t buflen);
+3 −1
Original line number Diff line number Diff line
@@ -210,6 +210,7 @@ static bool fs__env_override(struct fs *fs)
	size_t name_len = strlen(fs->name);
	/* name + "_PATH" + '\0' */
	char upper_name[name_len + 5 + 1];

	memcpy(upper_name, fs->name, name_len);
	mem_toupper(upper_name, name_len);
	strcpy(&upper_name[name_len], "_PATH");
@@ -219,7 +220,8 @@ static bool fs__env_override(struct fs *fs)
		return false;

	fs->found = true;
	strncpy(fs->path, override_path, sizeof(fs->path));
	strncpy(fs->path, override_path, sizeof(fs->path) - 1);
	fs->path[sizeof(fs->path) - 1] = '\0';
	return true;
}

+15 −0
Original line number Diff line number Diff line
@@ -71,3 +71,18 @@ int __bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
			   BITMAP_LAST_WORD_MASK(bits));
	return result != 0;
}

int __bitmap_equal(const unsigned long *bitmap1,
		const unsigned long *bitmap2, unsigned int bits)
{
	unsigned int k, lim = bits/BITS_PER_LONG;
	for (k = 0; k < lim; ++k)
		if (bitmap1[k] != bitmap2[k])
			return 0;

	if (bits % BITS_PER_LONG)
		if ((bitmap1[k] ^ bitmap2[k]) & BITMAP_LAST_WORD_MASK(bits))
			return 0;

	return 1;
}
+0 −0

File moved.

Loading