Lines Matching refs:dir
37 static int test_pmu_put(const char *dir, struct perf_pmu *hwm) in test_pmu_put() argument
42 if (scnprintf(buf, sizeof(buf), "rm -fr %s", dir) < 0) { in test_pmu_put()
43 pr_err("Failure to set up buffer for \"%s\"\n", dir); in test_pmu_put()
60 static struct perf_pmu *test_pmu_get(char *dir, size_t sz) in test_pmu_get() argument
79 scnprintf(dir, sz, "/tmp/perf-hwmon-pmu-test-XXXXXX"); in test_pmu_get()
80 if (!mkdtemp(dir)) { in test_pmu_get()
82 dir[0] = '\0'; in test_pmu_get()
85 test_dirfd = open(dir, O_PATH|O_DIRECTORY); in test_pmu_get()
87 pr_err("Failed to open test directory \"%s\"\n", dir); in test_pmu_get()
96 strncat(dir, "/hwmon1234", sz - strlen(dir)); in test_pmu_get()
97 hwmon_dirfd = open(dir, O_PATH|O_DIRECTORY); in test_pmu_get()
99 pr_err("Failed to open test hwmon directory \"%s\"\n", dir); in test_pmu_get()
134 hwm = perf_pmus__add_test_hwmon_pmu(dir, "hwmon1234", test_hwmon_name); in test_pmu_get()
140 test_pmu_put(dir, hwm); in test_pmu_get()
218 char dir[PATH_MAX]; in test__hwmon_pmu() local
219 struct perf_pmu *pmu = test_pmu_get(dir, sizeof(dir)); in test__hwmon_pmu()
236 test_pmu_put(dir, pmu); in test__hwmon_pmu()