Hi all,

I've been fighting this error and I can't make anything of it.

Basically this is what I have:
    pfm_perf_encode_arg_t arg;
    char **fstr;
    struct perf_event_attr attr;

    memset(&arg, 0, sizeof(arg));

     arg.size = sizeof(pfm_perf_encode_arg_t);
     arg.attr = &attr;
     arg.fstr = &fstr;

     //This Succeeds
     ret = pfm_get_os_event_encoding("INST_RETIRED", PFM_PLM3,
                PFM_OS_PERF_EVENT_EXT, &arg);
      fd = perf_event_open(&arg.attr, pid, -1, -1, 0);
      if (fd<0)
             err(1, "\nERROR: perf_event_open failed: %s", pfm_strerror(fd));

Now the problem is, fd is always -1 and it says:
            "ERROR: perf_event_open failed: not supported: Argument list too long"

I don't get how this comes to be.
Here's what my fstr contains:
fstr = ivb::INST_RETIRED:ANY_P:e=0:i=0:c=0:t=0:u=1:k=0:period=13831647021102465012:freq=13831647021102465012:precise=3:mg=0:mh=1

Any help will be highly appreciated.

Many thanks for your time.