Skip to content

Commit b2ced56

Browse files
committed
Merge: tracing/osnoise: Allow arbitrarily long CPU string
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/983 # Merge Request Required Information JIRA: https://issues.redhat.com/browse/RHEL-86520 ## Summary of Changes This improves the osnoise tracer option to handle arbitrarily long CPU strings. Before, it was limited to 256 characters, which was not enough for modern machines with lots of cores. ## Approved Development Ticket(s) All submissions to CentOS Stream must reference a ticket in [Red Hat Jira](https://issues.redhat.com/). <details><summary>Click for formatting instructions</summary> Please follow the CentOS Stream [contribution documentation](https://docs.centos.org/en-US/stream-contrib/quickstart/) for how to file this ticket and have it approved. List tickets each on their own line of this description using the format "Resolves: RHEL-76229", "Related: RHEL-76229" or "Reverts: RHEL-76229", as appropriate. </details> Signed-off-by: Tomas Glozar <tglozar@redhat.com> Approved-by: Luis Claudio R. Goncalves <lgoncalv@redhat.com> Approved-by: Gabriele Monaco <gmonaco@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Julio Faracco <jfaracco@redhat.com>
2 parents beb67fb + 89cd2fd commit b2ced56

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

kernel/trace/trace_osnoise.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2315,7 +2315,7 @@ osnoise_cpus_read(struct file *filp, char __user *ubuf, size_t count,
23152315
* osnoise_cpus_write - Write function for "cpus" entry
23162316
* @filp: The active open file structure
23172317
* @ubuf: The user buffer that contains the value to write
2318-
* @cnt: The maximum number of bytes to write to "file"
2318+
* @count: The maximum number of bytes to write to "file"
23192319
* @ppos: The current position in @file
23202320
*
23212321
* This function provides a write implementation for the "cpus"
@@ -2333,10 +2333,11 @@ osnoise_cpus_write(struct file *filp, const char __user *ubuf, size_t count,
23332333
{
23342334
cpumask_var_t osnoise_cpumask_new;
23352335
int running, err;
2336-
char buf[256];
2336+
char *buf __free(kfree) = NULL;
23372337

2338-
if (count >= 256)
2339-
return -EINVAL;
2338+
buf = kmalloc(count, GFP_KERNEL);
2339+
if (!buf)
2340+
return -ENOMEM;
23402341

23412342
if (copy_from_user(buf, ubuf, count))
23422343
return -EFAULT;

0 commit comments

Comments
 (0)