Skip to content

Commit e710574

Browse files
author
Ingo Molnar
committed
Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
2 parents a34668f + 9941c96 commit e710574

5 files changed

Lines changed: 46 additions & 23 deletions

File tree

‎tools/perf/Makefile‎

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ strip-libs = $(filter-out -l%,$(1))
181181

182182
$(OUTPUT)python/perf.so: $(PYRF_OBJS)
183183
$(QUIET_GEN)CFLAGS='$(BASIC_CFLAGS)' $(PYTHON_WORD) util/setup.py \
184-
--quiet build_ext \
185-
--build-lib='$(OUTPUT)python' \
186-
--build-temp='$(OUTPUT)python/temp'
184+
--quiet build_ext; \
185+
mkdir -p $(OUTPUT)python && \
186+
cp $(PYTHON_EXTBUILD_LIB)perf.so $(OUTPUT)python/
187187
#
188188
# No Perl scripts right now:
189189
#
@@ -509,9 +509,13 @@ else
509509

510510
PYTHON_WORD := $(call shell-wordify,$(PYTHON))
511511

512-
python-clean := $(PYTHON_WORD) util/setup.py clean \
513-
--build-lib='$(OUTPUT)python' \
514-
--build-temp='$(OUTPUT)python/temp'
512+
# python extension build directories
513+
PYTHON_EXTBUILD := $(OUTPUT)python_ext_build/
514+
PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
515+
PYTHON_EXTBUILD_TMP := $(PYTHON_EXTBUILD)tmp/
516+
export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
517+
518+
python-clean := rm -rf $(PYTHON_EXTBUILD) $(OUTPUT)python/perf.so
515519

516520
ifdef NO_LIBPYTHON
517521
$(call disable-python)
@@ -868,6 +872,9 @@ install: all
868872
$(INSTALL) scripts/python/*.py -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python'
869873
$(INSTALL) scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
870874

875+
install-python_ext:
876+
$(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)'
877+
871878
install-doc:
872879
$(MAKE) -C Documentation install
873880

@@ -895,7 +902,7 @@ quick-install-html:
895902
### Cleaning rules
896903

897904
clean:
898-
$(RM) $(OUTPUT){*.o,*/*.o,*/*/*.o,*/*/*/*.o,$(LIB_FILE),perf-archive}
905+
$(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf.o $(LANG_BINDINGS)
899906
$(RM) $(ALL_PROGRAMS) perf
900907
$(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope*
901908
$(MAKE) -C Documentation/ clean

‎tools/perf/builtin-lock.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -942,10 +942,10 @@ static const char *record_args[] = {
942942
"-f",
943943
"-m", "1024",
944944
"-c", "1",
945-
"-e", "lock:lock_acquire:r",
946-
"-e", "lock:lock_acquired:r",
947-
"-e", "lock:lock_contended:r",
948-
"-e", "lock:lock_release:r",
945+
"-e", "lock:lock_acquire",
946+
"-e", "lock:lock_acquired",
947+
"-e", "lock:lock_contended",
948+
"-e", "lock:lock_release",
949949
};
950950

951951
static int __cmd_record(int argc, const char **argv)

‎tools/perf/util/config.c‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,6 @@ static int perf_config_global(void)
399399
int perf_config(config_fn_t fn, void *data)
400400
{
401401
int ret = 0, found = 0;
402-
char *repo_config = NULL;
403402
const char *home = NULL;
404403

405404
/* Setting $PERF_CONFIG makes perf read _only_ the given config file. */
@@ -421,12 +420,6 @@ int perf_config(config_fn_t fn, void *data)
421420
free(user_config);
422421
}
423422

424-
repo_config = perf_pathdup("config");
425-
if (!access(repo_config, R_OK)) {
426-
ret += perf_config_from_file(fn, repo_config, data);
427-
found += 1;
428-
}
429-
free(repo_config);
430423
if (found == 0)
431424
return -1;
432425
return ret;

‎tools/perf/util/probe-event.c‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1820,11 +1820,15 @@ static int convert_to_probe_trace_events(struct perf_probe_event *pev,
18201820
ret = -ENOMEM;
18211821
goto error;
18221822
}
1823-
tev->point.module = strdup(module);
1824-
if (tev->point.module == NULL) {
1825-
ret = -ENOMEM;
1826-
goto error;
1823+
1824+
if (module) {
1825+
tev->point.module = strdup(module);
1826+
if (tev->point.module == NULL) {
1827+
ret = -ENOMEM;
1828+
goto error;
1829+
}
18271830
}
1831+
18281832
tev->point.offset = pev->point.offset;
18291833
tev->point.retprobe = pev->point.retprobe;
18301834
tev->nargs = pev->nargs;

‎tools/perf/util/setup.py‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,27 @@
33
from distutils.core import setup, Extension
44
from os import getenv
55

6+
from distutils.command.build_ext import build_ext as _build_ext
7+
from distutils.command.install_lib import install_lib as _install_lib
8+
9+
class build_ext(_build_ext):
10+
def finalize_options(self):
11+
_build_ext.finalize_options(self)
12+
self.build_lib = build_lib
13+
self.build_temp = build_tmp
14+
15+
class install_lib(_install_lib):
16+
def finalize_options(self):
17+
_install_lib.finalize_options(self)
18+
self.build_dir = build_lib
19+
20+
621
cflags = ['-fno-strict-aliasing', '-Wno-write-strings']
722
cflags += getenv('CFLAGS', '').split()
823

24+
build_lib = getenv('PYTHON_EXTBUILD_LIB')
25+
build_tmp = getenv('PYTHON_EXTBUILD_TMP')
26+
927
perf = Extension('perf',
1028
sources = ['util/python.c', 'util/ctype.c', 'util/evlist.c',
1129
'util/evsel.c', 'util/cpumap.c', 'util/thread_map.c',
@@ -21,4 +39,5 @@
2139
author_email='acme@redhat.com',
2240
license='GPLv2',
2341
url='http://perf.wiki.kernel.org',
24-
ext_modules=[perf])
42+
ext_modules=[perf],
43+
cmdclass={'build_ext': build_ext, 'install_lib': install_lib})

0 commit comments

Comments
 (0)