Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  perf tools: Fix tracepoint id to string perf.data header table
  perf tools: Fix handling of wildcards in tracepoint event selectors
  powerpc: perf: Fix frequency calculation for overflowing counters
This commit is contained in:
Linus Torvalds 2011-01-18 08:04:30 -08:00
commit c6fa63c659
3 changed files with 4 additions and 30 deletions

View File

@ -1212,6 +1212,7 @@ static void record_and_restart(struct perf_event *event, unsigned long val,
if (left <= 0) if (left <= 0)
left = period; left = period;
record = 1; record = 1;
event->hw.last_period = event->hw.sample_period;
} }
if (left < 0x80000000LL) if (left < 0x80000000LL)
val = 0x80000000LL - left; val = 0x80000000LL - left;

View File

@ -936,6 +936,8 @@ int cmd_record(int argc, const char **argv, const char *prefix __used)
list_for_each_entry(pos, &evsel_list, node) { list_for_each_entry(pos, &evsel_list, node) {
if (perf_evsel__alloc_fd(pos, cpus->nr, threads->nr) < 0) if (perf_evsel__alloc_fd(pos, cpus->nr, threads->nr) < 0)
goto out_free_fd; goto out_free_fd;
if (perf_header__push_event(pos->attr.config, event_name(pos)))
goto out_free_fd;
} }
event_array = malloc((sizeof(struct pollfd) * MAX_NR_CPUS * event_array = malloc((sizeof(struct pollfd) * MAX_NR_CPUS *
MAX_COUNTERS * threads->nr)); MAX_COUNTERS * threads->nr));

View File

@ -490,32 +490,6 @@ parse_multiple_tracepoint_event(char *sys_name, const char *evt_exp,
return EVT_HANDLED_ALL; return EVT_HANDLED_ALL;
} }
static int store_event_type(const char *orgname)
{
char filename[PATH_MAX], *c;
FILE *file;
int id, n;
sprintf(filename, "%s/", debugfs_path);
strncat(filename, orgname, strlen(orgname));
strcat(filename, "/id");
c = strchr(filename, ':');
if (c)
*c = '/';
file = fopen(filename, "r");
if (!file)
return 0;
n = fscanf(file, "%i", &id);
fclose(file);
if (n < 1) {
pr_err("cannot store event ID\n");
return -EINVAL;
}
return perf_header__push_event(id, orgname);
}
static enum event_result parse_tracepoint_event(const char **strp, static enum event_result parse_tracepoint_event(const char **strp,
struct perf_event_attr *attr) struct perf_event_attr *attr)
{ {
@ -555,13 +529,10 @@ static enum event_result parse_tracepoint_event(const char **strp,
if (evt_length >= MAX_EVENT_LENGTH) if (evt_length >= MAX_EVENT_LENGTH)
return EVT_FAILED; return EVT_FAILED;
if (strpbrk(evt_name, "*?")) { if (strpbrk(evt_name, "*?")) {
*strp += strlen(sys_name) + evt_length; *strp += strlen(sys_name) + evt_length + 1; /* 1 == the ':' */
return parse_multiple_tracepoint_event(sys_name, evt_name, return parse_multiple_tracepoint_event(sys_name, evt_name,
flags); flags);
} else { } else {
if (store_event_type(evt_name) < 0)
return EVT_FAILED;
return parse_single_tracepoint_event(sys_name, evt_name, return parse_single_tracepoint_event(sys_name, evt_name,
evt_length, attr, strp); evt_length, attr, strp);
} }