)]}'
{
  "commit": "2409cf42bce57992adc1791ccecf45fc812d465e",
  "tree": "6cec30e22388474f1e7c5da0f855ec0edce43b30",
  "parents": [
    "6ba6e19912570b2ad68298be0be1dc779014a303"
  ],
  "author": {
    "name": "Zhang Rui",
    "email": "rui.zhang@intel.com",
    "time": "Tue Aug 27 13:07:51 2024 +0800"
  },
  "committer": {
    "name": "Greg Kroah-Hartman",
    "email": "gregkh@linuxfoundation.org",
    "time": "Thu Dec 05 13:54:33 2024 +0100"
  },
  "message": "tools/power turbostat: Fix trailing \u0027\\n\u0027 parsing\n\n[ Upstream commit fed8511cc8996989178823052dc0200643e1389a ]\n\nparse_cpu_string() parses the string input either from command line or\nfrom /sys/fs/cgroup/cpuset.cpus.effective to get a list of CPUs that\nturbostat can run with.\n\nThe cpu string returned by /sys/fs/cgroup/cpuset.cpus.effective contains\na trailing \u0027\\n\u0027, but strtoul() fails to treat this as an error.\n\nThat says, for the code below\n\tval \u003d (\"\\n\", NULL, 10);\nval returns 0, and errno is also not set.\n\nAs a result, CPU0 is erroneously considered as allowed CPU and this\ncauses failures when turbostat tries to run on CPU0.\n\n get_counters: Could not migrate to CPU 0\n ...\n turbostat: re-initialized with num_cpus 8, allowed_cpus 5\n get_counters: Could not migrate to CPU 0\n\nAdd a check to return immediately if \u0027\\n\u0027 or \u0027\\0\u0027 is detected.\n\nFixes: 8c3dd2c9e542 (\"tools/power/turbostat: Abstrct function for parsing cpu string\")\nSigned-off-by: Zhang Rui \u003crui.zhang@intel.com\u003e\nSigned-off-by: Len Brown \u003clen.brown@intel.com\u003e\nSigned-off-by: Sasha Levin \u003csashal@kernel.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "089220aaa5c9291b5e0432ec1d0fa9b3f44b3e1a",
      "old_mode": 33188,
      "old_path": "tools/power/x86/turbostat/turbostat.c",
      "new_id": "aa9200319d0eafa7de394f91ad5b1113317f1749",
      "new_mode": 33188,
      "new_path": "tools/power/x86/turbostat/turbostat.c"
    }
  ]
}
