0

When try to start perf ftrace I get following error

write '' to tracing/tracing_cpumask failed: Invalid argument
failed to reset ftrace

However my kernel configured ftrace enabled and trace-cmd ftrace frontend also works as well.


For some reason in the perf/builtin-ftrace.c file in the write_tracing_file function I get

static int __write_tracing_file(const char *name, const char *val, bool append)
{
        char *file;
        int fd, ret = -1;
        ssize_t size = strlen(val);

I got val == an empty string, therefore size == 0

Then at the following section

if (write(fd, val_copy, size + 1) == size + 1)
                ret = 0;
        else
                pr_debug("write '%s' to tracing/%s failed: %s\n",
                         val, name, str_error_r(errno, errbuf, sizeof(errbuf)));

I got size = 0 and which not ok. So something wrong with the CPU mask part but I have no clue what.


Edit: looks like its work with multicore system without problem, but not in single core system. Strange...

SPYFF
  • 133
  • 1
  • 6

2 Answers2

0

I solved the issue somehow. Installed all the dependencies of perf including libnuma-dev etc. Now it works.

SPYFF
  • 133
  • 1
  • 6
0

Because perf version is not matched with current kernel.

if you install perf by yum. it will install the newest verison perf. you need download the matched perf from web and install it.

qq33
  • 1