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

Commit 9c17dbc6 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 improvements and fixes from Arnaldo Carvalho de Melo:

  - Accept a zero --itrace period, meaning "as often as possible".  In the case
    of Intel PT that is the same as a period of 1 and a unit of 'instructions'
    (i.e.  --itrace=i1i). (Adrian Hunter)

  - Harmonize itrace's synthesized callchains with the existing --max-stack
    tool option. (Adrian Hunter)

  - Allow time to be displayed in nanoseconds in 'perf script'. (Adrian Hunter)

  - Fix potential infinite loop when handling Intel PT timestamps. (Adrian Hunter)

  - Slighly improve Intel PT debug logging. (Adrian Hunter)

  - Warn when AUX data has been lost, just like when processing PERF_RECORD_LOST.
    (Adrian Hunter)

  - Further document export-to-postgresql.py script. (Adrian Hunter)

  - Add option to synthesize branch stack from auxtrace data. (Adrian Hunter)

  - Use equivalent logic to avoid using dso->kernel. (Arnaldo Carvalho de Melo)

  - Show proper error messages when parsing bad terms for hw/sw events. (He Kuang)

  - Tracepoint event parsing improvements. (He Kuang)

  - Store tracing mountpoint for better error message. (Jiri Olsa)

  - Add fixdep to tools/build, bringing it closer to the kernel counterpart, from
    where it is being lifted. (Jiri Olsa)

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 18ab2cd3 e637d177
Loading
Loading
Loading
Loading

tools/build/Build

0 → 100644
+1 −0
Original line number Original line Diff line number Diff line
fixdep-y := fixdep.o
+14 −3
Original line number Original line Diff line number Diff line
@@ -54,15 +54,26 @@ make-cmd = $(call escsq,$(subst \#,\\\#,$(subst $$,$$$$,$(cmd_$(1)))))
# PHONY targets skipped in both cases.
# PHONY targets skipped in both cases.
any-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^)
any-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^)


###
# Copy dependency data into .cmd file
#  - gcc -M dependency info
#  - command line to create object 'cmd_object :='
dep-cmd = $(if $(wildcard $(fixdep)),                                           \
           $(fixdep) $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp;           \
           rm -f $(depfile);                                                    \
           mv -f $(dot-target).tmp $(dot-target).cmd,                           \
           printf '\# cannot find fixdep (%s)\n' $(fixdep) > $(dot-target).cmd; \
           printf '\# using basic dep data\n\n' >> $(dot-target).cmd;           \
           cat $(depfile) >> $(dot-target).cmd;                                 \
           printf '%s\n' 'cmd_$@ := $(make-cmd)' >> $(dot-target).cmd)

###
###
# if_changed_dep  - execute command if any prerequisite is newer than
# if_changed_dep  - execute command if any prerequisite is newer than
#                   target, or command line has changed and update
#                   target, or command line has changed and update
#                   dependencies in the cmd file
#                   dependencies in the cmd file
if_changed_dep = $(if $(strip $(any-prereq) $(arg-check)),         \
if_changed_dep = $(if $(strip $(any-prereq) $(arg-check)),         \
	@set -e;                                                   \
	@set -e;                                                   \
	$(echo-cmd) $(cmd_$(1));                                   \
	$(echo-cmd) $(cmd_$(1)) && $(dep-cmd))
	cat $(depfile) > $(dot-target).cmd;                        \
	printf '%s\n' 'cmd_$@ := $(make-cmd)' >> $(dot-target).cmd)


# if_changed      - execute command if any prerequisite is newer than
# if_changed      - execute command if any prerequisite is newer than
#                   target, or command line has changed
#                   target, or command line has changed
+39 −13
Original line number Original line Diff line number Diff line
@@ -11,8 +11,9 @@ Unlike the kernel we don't have a single build object 'obj-y' list that where
we setup source objects, but we support more. This allows one 'Build' file to
we setup source objects, but we support more. This allows one 'Build' file to
carry a sources list for multiple build objects.
carry a sources list for multiple build objects.


a) Build framework makefiles

----------------------------
Build framework makefiles
-------------------------


The build framework consists of 2 Makefiles:
The build framework consists of 2 Makefiles:


@@ -23,7 +24,7 @@ While the 'Build.include' file contains just some generic definitions, the
'Makefile.build' file is the makefile used from the outside. It's
'Makefile.build' file is the makefile used from the outside. It's
interface/usage is following:
interface/usage is following:


  $ make -f tools/build/Makefile srctree=$(KSRC) dir=$(DIR) obj=$(OBJECT)
  $ make -f tools/build/Makefile.build srctree=$(KSRC) dir=$(DIR) obj=$(OBJECT)


where:
where:


@@ -38,8 +39,9 @@ called $(OBJECT)-in.o:


which includes all compiled sources described in 'Build' makefiles.
which includes all compiled sources described in 'Build' makefiles.


a) Build makefiles

------------------
Build makefiles
---------------


The user supplies 'Build' makefiles that contains a objects list, and connects
The user supplies 'Build' makefiles that contains a objects list, and connects
the build to nested directories.
the build to nested directories.
@@ -95,8 +97,31 @@ It's only a matter of 2 single commands to create the final binaries:


You can check the 'ex' example in 'tools/build/tests/ex' for more details.
You can check the 'ex' example in 'tools/build/tests/ex' for more details.


b) Rules

--------
Makefile.include
----------------

The tools/build/Makefile.include makefile could be included
via user makefiles to get usefull definitions.

It defines following interface:

  - build macro definition:
      build := -f $(srctree)/tools/build/Makefile.build dir=. obj

    to make it easier to invoke build like:
      make $(build)=ex


Fixdep
------
It is necessary to build the fixdep helper before invoking the build.
The Makefile.include file adds the fixdep target, that could be
invoked by the user.


Rules
-----


The build framework provides standard compilation rules to handle .S and .c
The build framework provides standard compilation rules to handle .S and .c
compilation.
compilation.
@@ -104,8 +129,9 @@ compilation.
It's possible to include special rule if needed (like we do for flex or bison
It's possible to include special rule if needed (like we do for flex or bison
code generation).
code generation).


c) CFLAGS

---------
CFLAGS
------


It's possible to alter the standard object C flags in the following way:
It's possible to alter the standard object C flags in the following way:


@@ -115,8 +141,8 @@ It's possible to alter the standard object C flags in the following way:
This C flags changes has the scope of the Build makefile they are defined in.
This C flags changes has the scope of the Build makefile they are defined in.




d) Dependencies
Dependencies
---------------
------------


For each built object file 'a.o' the '.a.cmd' is created and holds:
For each built object file 'a.o' the '.a.cmd' is created and holds:


@@ -130,8 +156,8 @@ All existing '.cmd' files are included in the Build process to follow properly
the dependencies and trigger a rebuild when necessary.
the dependencies and trigger a rebuild when necessary.




e) Single rules
Single rules
---------------
------------


It's possible to build single object file by choice, like:
It's possible to build single object file by choice, like:


tools/build/Makefile

0 → 100644
+43 −0
Original line number Original line Diff line number Diff line
ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd)))
srctree := $(patsubst %/,%,$(dir $(srctree)))
endif

include $(srctree)/tools//scripts/Makefile.include

define allow-override
  $(if $(or $(findstring environment,$(origin $(1))),\
            $(findstring command line,$(origin $(1)))),,\
    $(eval $(1) = $(2)))
endef

$(call allow-override,CC,$(CROSS_COMPILE)gcc)
$(call allow-override,LD,$(CROSS_COMPILE)ld)

ifeq ($(V),1)
  Q =
else
  Q = @
endif

export Q srctree CC LD

MAKEFLAGS := --no-print-directory
build     := -f $(srctree)/tools/build/Makefile.build dir=. obj

all: fixdep

clean:
	$(call QUIET_CLEAN, fixdep)
	$(Q)find . -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
	$(Q)rm -f fixdep

$(OUTPUT)fixdep-in.o: FORCE
	$(Q)$(MAKE) $(build)=fixdep

$(OUTPUT)fixdep: $(OUTPUT)fixdep-in.o
	$(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $<

FORCE:

.PHONY: FORCE
+7 −0
Original line number Original line Diff line number Diff line
@@ -21,6 +21,13 @@ endif


build-dir := $(srctree)/tools/build
build-dir := $(srctree)/tools/build


# Define $(fixdep) for dep-cmd function
ifeq ($(OUTPUT),)
  fixdep := $(build-dir)/fixdep
else
  fixdep := $(OUTPUT)/fixdep
endif

# Generic definitions
# Generic definitions
include $(build-dir)/Build.include
include $(build-dir)/Build.include


Loading