Skip to content

Commit

Permalink
Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/acme/linux into perf/urgent
  • Loading branch information
Ingo Molnar committed Aug 9, 2011
2 parents a34668f + 9941c96 commit e710574
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 23 deletions.
21 changes: 14 additions & 7 deletions tools/perf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ strip-libs = $(filter-out -l%,$(1))

$(OUTPUT)python/perf.so: $(PYRF_OBJS)
$(QUIET_GEN)CFLAGS='$(BASIC_CFLAGS)' $(PYTHON_WORD) util/setup.py \
--quiet build_ext \
--build-lib='$(OUTPUT)python' \
--build-temp='$(OUTPUT)python/temp'
--quiet build_ext; \
mkdir -p $(OUTPUT)python && \
cp $(PYTHON_EXTBUILD_LIB)perf.so $(OUTPUT)python/
#
# No Perl scripts right now:
#
Expand Down Expand Up @@ -509,9 +509,13 @@ else

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

python-clean := $(PYTHON_WORD) util/setup.py clean \
--build-lib='$(OUTPUT)python' \
--build-temp='$(OUTPUT)python/temp'
# python extension build directories
PYTHON_EXTBUILD := $(OUTPUT)python_ext_build/
PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
PYTHON_EXTBUILD_TMP := $(PYTHON_EXTBUILD)tmp/
export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP

python-clean := rm -rf $(PYTHON_EXTBUILD) $(OUTPUT)python/perf.so

ifdef NO_LIBPYTHON
$(call disable-python)
Expand Down Expand Up @@ -868,6 +872,9 @@ install: all
$(INSTALL) scripts/python/*.py -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python'
$(INSTALL) scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'

install-python_ext:
$(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)'

install-doc:
$(MAKE) -C Documentation install

Expand Down Expand Up @@ -895,7 +902,7 @@ quick-install-html:
### Cleaning rules

clean:
$(RM) $(OUTPUT){*.o,*/*.o,*/*/*.o,*/*/*/*.o,$(LIB_FILE),perf-archive}
$(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf.o $(LANG_BINDINGS)
$(RM) $(ALL_PROGRAMS) perf
$(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope*
$(MAKE) -C Documentation/ clean
Expand Down
8 changes: 4 additions & 4 deletions tools/perf/builtin-lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -942,10 +942,10 @@ static const char *record_args[] = {
"-f",
"-m", "1024",
"-c", "1",
"-e", "lock:lock_acquire:r",
"-e", "lock:lock_acquired:r",
"-e", "lock:lock_contended:r",
"-e", "lock:lock_release:r",
"-e", "lock:lock_acquire",
"-e", "lock:lock_acquired",
"-e", "lock:lock_contended",
"-e", "lock:lock_release",
};

static int __cmd_record(int argc, const char **argv)
Expand Down
7 changes: 0 additions & 7 deletions tools/perf/util/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,6 @@ static int perf_config_global(void)
int perf_config(config_fn_t fn, void *data)
{
int ret = 0, found = 0;
char *repo_config = NULL;
const char *home = NULL;

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

repo_config = perf_pathdup("config");
if (!access(repo_config, R_OK)) {
ret += perf_config_from_file(fn, repo_config, data);
found += 1;
}
free(repo_config);
if (found == 0)
return -1;
return ret;
Expand Down
12 changes: 8 additions & 4 deletions tools/perf/util/probe-event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1820,11 +1820,15 @@ static int convert_to_probe_trace_events(struct perf_probe_event *pev,
ret = -ENOMEM;
goto error;
}
tev->point.module = strdup(module);
if (tev->point.module == NULL) {
ret = -ENOMEM;
goto error;

if (module) {
tev->point.module = strdup(module);
if (tev->point.module == NULL) {
ret = -ENOMEM;
goto error;
}
}

tev->point.offset = pev->point.offset;
tev->point.retprobe = pev->point.retprobe;
tev->nargs = pev->nargs;
Expand Down
21 changes: 20 additions & 1 deletion tools/perf/util/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,27 @@
from distutils.core import setup, Extension
from os import getenv

from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib

class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_options(self)
self.build_lib = build_lib
self.build_temp = build_tmp

class install_lib(_install_lib):
def finalize_options(self):
_install_lib.finalize_options(self)
self.build_dir = build_lib


cflags = ['-fno-strict-aliasing', '-Wno-write-strings']
cflags += getenv('CFLAGS', '').split()

build_lib = getenv('PYTHON_EXTBUILD_LIB')
build_tmp = getenv('PYTHON_EXTBUILD_TMP')

perf = Extension('perf',
sources = ['util/python.c', 'util/ctype.c', 'util/evlist.c',
'util/evsel.c', 'util/cpumap.c', 'util/thread_map.c',
Expand All @@ -21,4 +39,5 @@
author_email='[email protected]',
license='GPLv2',
url='http://perf.wiki.kernel.org',
ext_modules=[perf])
ext_modules=[perf],
cmdclass={'build_ext': build_ext, 'install_lib': install_lib})

0 comments on commit e710574

Please sign in to comment.