|
@@ -3,7 +3,6 @@
|
|
|
#include "parse-options.h"
|
|
|
#include "evsel.h"
|
|
|
#include "cgroup.h"
|
|
|
-#include "debugfs.h" /* MAX_PATH, STR() */
|
|
|
#include "evlist.h"
|
|
|
|
|
|
int nr_cgroups;
|
|
@@ -12,7 +11,7 @@ static int
|
|
|
cgroupfs_find_mountpoint(char *buf, size_t maxlen)
|
|
|
{
|
|
|
FILE *fp;
|
|
|
- char mountpoint[MAX_PATH+1], tokens[MAX_PATH+1], type[MAX_PATH+1];
|
|
|
+ char mountpoint[PATH_MAX + 1], tokens[PATH_MAX + 1], type[PATH_MAX + 1];
|
|
|
char *token, *saved_ptr = NULL;
|
|
|
int found = 0;
|
|
|
|
|
@@ -25,8 +24,8 @@ cgroupfs_find_mountpoint(char *buf, size_t maxlen)
|
|
|
* and inspect every cgroupfs mount point to find one that has
|
|
|
* perf_event subsystem
|
|
|
*/
|
|
|
- while (fscanf(fp, "%*s %"STR(MAX_PATH)"s %"STR(MAX_PATH)"s %"
|
|
|
- STR(MAX_PATH)"s %*d %*d\n",
|
|
|
+ while (fscanf(fp, "%*s %"STR(PATH_MAX)"s %"STR(PATH_MAX)"s %"
|
|
|
+ STR(PATH_MAX)"s %*d %*d\n",
|
|
|
mountpoint, type, tokens) == 3) {
|
|
|
|
|
|
if (!strcmp(type, "cgroup")) {
|
|
@@ -57,15 +56,15 @@ cgroupfs_find_mountpoint(char *buf, size_t maxlen)
|
|
|
|
|
|
static int open_cgroup(char *name)
|
|
|
{
|
|
|
- char path[MAX_PATH+1];
|
|
|
- char mnt[MAX_PATH+1];
|
|
|
+ char path[PATH_MAX + 1];
|
|
|
+ char mnt[PATH_MAX + 1];
|
|
|
int fd;
|
|
|
|
|
|
|
|
|
- if (cgroupfs_find_mountpoint(mnt, MAX_PATH+1))
|
|
|
+ if (cgroupfs_find_mountpoint(mnt, PATH_MAX + 1))
|
|
|
return -1;
|
|
|
|
|
|
- snprintf(path, MAX_PATH, "%s/%s", mnt, name);
|
|
|
+ snprintf(path, PATH_MAX, "%s/%s", mnt, name);
|
|
|
|
|
|
fd = open(path, O_RDONLY);
|
|
|
if (fd == -1)
|