lkml.org 
[lkml]   [2014]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 13/52] perf tools: Add perf_pmu__scan_file()
On Tue, Jul 22, 2014 at 04:17:22PM +0300, Adrian Hunter wrote:

SNIP

> +
> +static FILE *perf_pmu__open_file(struct perf_pmu *pmu, const char *name)
> +{
> + struct stat st;
> + char path[PATH_MAX];
> + const char *sysfs;
> +
> + sysfs = sysfs__mountpoint();
> + if (!sysfs)
> + return NULL;
> +
> + snprintf(path, PATH_MAX,
> + "%s" EVENT_SOURCE_DEVICE_PATH "%s/%s", sysfs, pmu->name, name);
> +
> + if (stat(path, &st) < 0)
> + return NULL;
> +
> + return fopen(path, "r");
> +}

looks like this function could be used in pmu_cpumask and pmu_type
and maybe others

jirka


\
 
 \ /
  Last update: 2014-07-22 21:41    [W:0.455 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site