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

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

Merge tag 'perf-urgent-for-mingo-4.17-20180409' of...

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

 into perf/urgent

Pull perf/urgent fixes from Arnaldo Carvalho de Melo:

. Fix the --stdio2/TUI annotate output to include group details,
  be it for a recorded '{a,b,f}' explicit event group or when
  forcing group display using 'perf report --group' for a set of
  events not recorded as a group (Arnaldo Carvalho de Melo)

. Fix display artifacts in the ui browser (base class for the
  annotate and main report/top TUI browser) related to the extra
  title lines work (Arnaldo Carvalho de Melo)

. perf auxtrace refactorings, leftovers from a previously partially
  processed patchset (Adrian Hunter)

. Fix the builtin clang build (Sandipan Das, Arnaldo Carvalho de Melo)

- Synchronize i915_drm.h, silencing a perf build warning and
  in the process automagically adding support for a new ioctl
  command (Arnaldo Carvalho de Melo)

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 621b6d2e fcbd8fa4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -364,7 +364,8 @@ LIBS = -Wl,--whole-archive $(PERFLIBS) $(EXTRA_PERFLIBS) -Wl,--no-whole-archive

ifeq ($(USE_CLANG), 1)
  CLANGLIBS_LIST = AST Basic CodeGen Driver Frontend Lex Tooling Edit Sema Analysis Parse Serialization
  LIBCLANG = $(foreach l,$(CLANGLIBS_LIST),$(wildcard $(shell $(LLVM_CONFIG) --libdir)/libclang$(l).a))
  CLANGLIBS_NOEXT_LIST = $(foreach l,$(CLANGLIBS_LIST),$(shell $(LLVM_CONFIG) --libdir)/libclang$(l))
  LIBCLANG = $(foreach l,$(CLANGLIBS_NOEXT_LIST),$(wildcard $(l).a $(l).so))
  LIBS += -Wl,--start-group $(LIBCLANG) -Wl,--end-group
endif

+4 −9
Original line number Diff line number Diff line
@@ -659,9 +659,10 @@ int hist_browser__run(struct hist_browser *browser, const char *help,
			struct hist_entry *h = rb_entry(browser->b.top,
							struct hist_entry, rb_node);
			ui_helpline__pop();
			ui_helpline__fpush("%d: nr_ent=(%d,%d), rows=%d, idx=%d, fve: idx=%d, row_off=%d, nrows=%d",
			ui_helpline__fpush("%d: nr_ent=(%d,%d), etl: %d, rows=%d, idx=%d, fve: idx=%d, row_off=%d, nrows=%d",
					   seq++, browser->b.nr_entries,
					   browser->hists->nr_entries,
					   browser->b.extra_title_lines,
					   browser->b.rows,
					   browser->b.index,
					   browser->b.top_idx,
@@ -1743,17 +1744,11 @@ static void ui_browser__hists_init_top(struct ui_browser *browser)
static unsigned int hist_browser__refresh(struct ui_browser *browser)
{
	unsigned row = 0;
	u16 header_offset = 0;
	struct rb_node *nd;
	struct hist_browser *hb = container_of(browser, struct hist_browser, b);
	struct hists *hists = hb->hists;

	if (hb->show_headers) {
		struct perf_hpp_list *hpp_list = hists->hpp_list;

	if (hb->show_headers)
		hist_browser__show_headers(hb);
		header_offset = hpp_list->nr_header_lines;
	}

	ui_browser__hists_init_top(browser);
	hb->he_selection = NULL;
@@ -1791,7 +1786,7 @@ static unsigned int hist_browser__refresh(struct ui_browser *browser)
			break;
	}

	return row + header_offset;
	return row;
}

static struct rb_node *hists__filter_entries(struct rb_node *nd,
+10 −10
Original line number Diff line number Diff line
@@ -302,6 +302,13 @@ static int auxtrace_queues__split_buffer(struct auxtrace_queues *queues,
	return 0;
}

static bool filter_cpu(struct perf_session *session, int cpu)
{
	unsigned long *cpu_bitmap = session->itrace_synth_opts->cpu_bitmap;

	return cpu_bitmap && cpu != -1 && !test_bit(cpu, cpu_bitmap);
}

static int auxtrace_queues__add_buffer(struct auxtrace_queues *queues,
				       struct perf_session *session,
				       unsigned int idx,
@@ -310,6 +317,9 @@ static int auxtrace_queues__add_buffer(struct auxtrace_queues *queues,
{
	int err = -ENOMEM;

	if (filter_cpu(session, buffer->cpu))
		return 0;

	buffer = memdup(buffer, sizeof(*buffer));
	if (!buffer)
		return -ENOMEM;
@@ -344,13 +354,6 @@ static int auxtrace_queues__add_buffer(struct auxtrace_queues *queues,
	return err;
}

static bool filter_cpu(struct perf_session *session, int cpu)
{
	unsigned long *cpu_bitmap = session->itrace_synth_opts->cpu_bitmap;

	return cpu_bitmap && cpu != -1 && !test_bit(cpu, cpu_bitmap);
}

int auxtrace_queues__add_event(struct auxtrace_queues *queues,
			       struct perf_session *session,
			       union perf_event *event, off_t data_offset,
@@ -367,9 +370,6 @@ int auxtrace_queues__add_event(struct auxtrace_queues *queues,
	};
	unsigned int idx = event->auxtrace.idx;

	if (filter_cpu(session, event->auxtrace.cpu))
		return 0;

	return auxtrace_queues__add_buffer(queues, session, idx, &buffer,
					   buffer_ptr);
}
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ int test__clang_to_IR(void)
	if (!M)
		return -1;
	for (llvm::Function& F : *M)
		if (F.getName() == "bpf_func__SyS_epoll_wait")
		if (F.getName() == "bpf_func__SyS_epoll_pwait")
			return 0;
	return -1;
}
+10 −1
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
 * Copyright (C) 2016 Huawei Inc.
 */

#include "clang/Basic/Version.h"
#include "clang/CodeGen/CodeGenAction.h"
#include "clang/Frontend/CompilerInvocation.h"
#include "clang/Frontend/CompilerInstance.h"
@@ -58,7 +59,8 @@ createCompilerInvocation(llvm::opt::ArgStringList CFlags, StringRef& Path,

	FrontendOptions& Opts = CI->getFrontendOpts();
	Opts.Inputs.clear();
	Opts.Inputs.emplace_back(Path, IK_C);
	Opts.Inputs.emplace_back(Path,
			FrontendOptions::getInputKindForExtension("c"));
	return CI;
}

@@ -71,10 +73,17 @@ getModuleFromSource(llvm::opt::ArgStringList CFlags,

	Clang.setVirtualFileSystem(&*VFS);

#if CLANG_VERSION_MAJOR < 4
	IntrusiveRefCntPtr<CompilerInvocation> CI =
		createCompilerInvocation(std::move(CFlags), Path,
					 Clang.getDiagnostics());
	Clang.setInvocation(&*CI);
#else
	std::shared_ptr<CompilerInvocation> CI(
		createCompilerInvocation(std::move(CFlags), Path,
					 Clang.getDiagnostics()));
	Clang.setInvocation(CI);
#endif

	std::unique_ptr<CodeGenAction> Act(new EmitLLVMOnlyAction(&*LLVMCtx));
	if (!Clang.ExecuteAction(*Act))
Loading