perf/urgent fixes:

. 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: Arnaldo Carvalho de Melo <acme@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEELb9bqkb7Te0zijNb1lAW81NSqkAFAlrLhGcACgkQ1lAW81NS
 qkD2Og//RGG6FGOQM/UPnRGUViQbQMXCmfTm9G/SwsOLHXiYSTNgTI+FkJF+tMlv
 y7KOW54izqVPpxWniQs8PwIELw50Iu+EMaLjYhyY5v3eeE/HUoa1XKUa+YBgPm92
 zNulgDWfHOk83loROqS4VKv/hAHs3z87VB35TxIXC2kTICmYwuLfcKbbL2q9M3aT
 GT9OnxAxtYeYvZcdZLWNP4atSXw7MvgoFwki/ZiQyFeHHlOg8UpPEaQJg/mauxPY
 1CyTDq1ZfCaGCV7Qq+QsPJrFLbKn43iNobDuEcxGd4y5dTAc1VBphBhdBSwQUojc
 3uxGVNz7QDgslH8TcU7H87jMzwQUtdss73DTLG6p08Nc9ap704kaj5BKVJgwoPRF
 w7kPRz2tboSeItG/wCZHgptHCdrr9XUhGz1vvaZS5d0N1Lc4/EfBDbyf1YS//eEg
 myRdyK+vB0mXQ1s2+byrA628cgZqbuAhxJbLxLbsIcbn7tJrpbsFFxA0FIzICL3o
 EjPIckx86JkGWbJERDUFCSTY2P6hjVRmQfrOLJxXEDnd/4/cO8wvnaGojL7a7pvG
 +vQKDrTFWl6LJSSOe3J7YB/eY+jfsSqqVaN2yP8PhOJX5w/whwXIjdITv+PqD6Nx
 SXho4tNhpE1QfFl5Nw/bqXdZYfm+OjtjipDs1UQiJpT2GnWb3FM=
 =xDuy
 -----END PGP SIGNATURE-----

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: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
Ingo Molnar 2018-04-10 07:21:54 +02:00
commit e31193a9fe
6 changed files with 29 additions and 24 deletions

View File

@ -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

View File

@ -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,

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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))

View File

@ -11,8 +11,7 @@
#include <stdlib.h>
#include <stdarg.h>
#include <linux/compiler.h>
#include <linux/types.h>
#include "namespaces.h"
#include <sys/types.h>
/* General helper functions */
void usage(const char *err) __noreturn;
@ -26,6 +25,7 @@ static inline void *zalloc(size_t size)
#define zfree(ptr) ({ free(*ptr); *ptr = NULL; })
struct dirent;
struct nsinfo;
struct strlist;
int mkdir_p(char *path, mode_t mode);