lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <xhsmhr0nib674.mognet@vschneid.remote.csb>
Date:   Fri, 01 Sep 2023 11:20:31 +0200
From:   Valentin Schneider <vschneid@...hat.com>
To:     Steven Rostedt <rostedt@...dmis.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Ajay Kaher <akaher@...are.com>,
        Eric Vaughn <ervaughn@...ux.microsoft.com>,
        Sishuai Gong <sishuai.system@...il.com>,
        Uros Bizjak <ubizjak@...il.com>,
        Yue Haibing <yuehaibing@...wei.com>,
        Zhang Zekun <zhangzekun11@...wei.com>,
        Zheng Yejian <zhengyejian1@...wei.com>
Subject: Re: [GIT PULL] tracing: Updates for 6.6

Hi,

On 31/08/23 11:56, Steven Rostedt wrote:
> Linus,
>
> [ Note, there's a minor conflict which should be fixed by:
>         mutex_lock(&trace_types_lock);
> -       if (unlikely(tr->current_trace && iter->trace->name != tr->current_trace->name)) {
> +       if (unlikely(tr->current_trace != iter->trace))
>  +              /* Close iter->trace before switching to the new current tracer */
>  +              if (iter->trace->close)
>  +                      iter->trace->close(iter);
> -               *iter->trace = *tr->current_trace;
> +               iter->trace = tr->current_trace;
>  +              /* Reopen the new current tracer */
>  +              if (iter->trace->open)
>  +                      iter->trace->open(iter);
>  +      }
>         mutex_unlock(&trace_types_lock);
> ]
>
> Tracing updates for 6.6:
>
>  User visible changes:
>
>   - Added a way to easier filter with cpumasks:
>      # echo 'cpumask & CPUS{17-42}' > /sys/kernel/tracing/events/ipi_send_cpumask/filter
>

It looks like the patches included are from v2 of [1], which still had some
(small) issues to fix. I have addressed these in [2], but I haven't sent
this out yet as I'm still working on the context_tracking/vmalloc part of
the series.

I'm happy to send just the tracing bits, if that helps - or just send the
deltas as separate fixes, whatever makes it easier.

Apologies for not bringing this up when the patches were picked up in [3],
I've only just come back from PTO/moving abroad and have started catching
up.

[1]: https://lore.kernel.org/all/20230720163056.2564824-1-vschneid@redhat.com/
[2]: https://gitlab.com/vschneid/linux/-/commits/redhat/isolirq/defer/v3-wip
[3]: https://lore.kernel.org/all/20230824021812.938245293@goodmis.org/

For reference, the git range-diff between the patches in
tracing/trace/for-next and those in my v3 is appended below (pure changelog
diffs removed)

---
 2:  39f7c41c908bc !  2:  e58d79bd79da2 tracing/filters: Enable filtering a cpumask field by another cpumask
      ## include/linux/trace_events.h ##
     @@ include/linux/trace_events.h: enum {
    @@ kernel/trace/trace_events_filter.c: static void filter_free_subsystem_filters(st
     +			return FILTER_DYN_STRING;
     +		if (strstr(type, "cpumask_t"))
     +			return FILTER_CPUMASK;
    -+		}
    ++	}

        if (strstr(type, "__rel_loc") && strstr(type, "char"))
                return FILTER_RDYN_STRING;
    @@ kernel/trace/trace_events_filter.c: static int parse_pred(const char *str, void
     +		maskstart = i;
     +
     +		/* Walk the cpulist until closing } */
    -+		for (; str[i] && str[i] != '}'; i++);
    ++		for (; str[i] && str[i] != '}'; i++)
    ++			;
    ++
     +		if (str[i] != '}') {
     +			parse_error(pe, FILT_ERR_MISSING_BRACE_CLOSE, pos + i);
     +			goto err_free;
    @@ kernel/trace/trace_events_filter.c: static int parse_pred(const char *str, void
     +
     +		/* Copy the cpulist between { and } */
     +		tmp = kmalloc((i - maskstart) + 1, GFP_KERNEL);
    -+		strscpy(tmp, str + maskstart, (i - maskstart) + 1);
    ++		if (!tmp)
    ++			goto err_mem;
     +
    ++		strscpy(tmp, str + maskstart, (i - maskstart) + 1);
     +		pred->mask = kzalloc(cpumask_size(), GFP_KERNEL);
    -+		if (!pred->mask)
    ++		if (!pred->mask) {
    ++			kfree(tmp);
     +			goto err_mem;
    ++		}
     +
     +		/* Now parse it */
     +		if (cpulist_parse(tmp, pred->mask)) {
    ++			kfree(tmp);
     +			parse_error(pe, FILT_ERR_INVALID_CPULIST, pos + i);
     +			goto err_free;
     +		}
    ++		kfree(tmp);
     +
     +		/* Move along */
     +		i++;
 5:  fe4fa4ec9b464 !  5:  03eefdab555b2 tracing/filters: Optimise cpumask vs cpumask filtering when user mask is a single CPU
      ## kernel/trace/trace_events_filter.c ##
     @@ kernel/trace/trace_events_filter.c: enum filter_pred_fn {
    @@ kernel/trace/trace_events_filter.c: static int parse_pred(const char *str, void
     +		if (single && field->filter_type == FILTER_CPUMASK) {
     +			pred->val = cpumask_first(pred->mask);
     +			kfree(pred->mask);
    ++			pred->mask = NULL;
     +		}
     +
                if (field->filter_type == FILTER_CPUMASK) {
 6:  ca77dd8ce4658 !  6:  f75aee048ce5a tracing/filters: Optimise scalar vs cpumask filtering when the user mask is a single CPU
    @@ Commit message
      ## kernel/trace/trace_events_filter.c ##
     @@ kernel/trace/trace_events_filter.c: static int parse_pred(const char *str, void *data,
    @@ kernel/trace/trace_events_filter.c: static int parse_pred(const char *str, void
     +		if (single && field->filter_type != FILTER_CPU) {
                        pred->val = cpumask_first(pred->mask);
                        kfree(pred->mask);
    -		}
    +			pred->mask = NULL;
     @@ kernel/trace/trace_events_filter.c: static int parse_pred(const char *str, void *data,
                                FILTER_PRED_FN_CPUMASK;
                } else if (field->filter_type == FILTER_CPU) {
                        pred->fn_num = FILTER_PRED_FN_CPU_CPUMASK;
     +		} else if (single) {
    -+			pred->op = pred->op == OP_BAND ? OP_EQ : pred->op;
    ++			if (pred->op == OP_BAND)
    ++				pred->op = OP_EQ;
    ++
     +			pred->fn_num = select_comparison_fn(pred->op, field->size, false);
     +			if (pred->op == OP_NE)
     +				pred->not = 1;
 7:  1cffbe6c62f10 !  7:  6a78ed47b0b06 tracing/filters: Optimise CPU vs cpumask filtering when the user mask is a single CPU
      ## kernel/trace/trace_events_filter.c ##
     @@ kernel/trace/trace_events_filter.c: static int parse_pred(const char *str, void *data,
    @@ kernel/trace/trace_events_filter.c: static int parse_pred(const char *str, void
     +		if (single) {
                        pred->val = cpumask_first(pred->mask);
                        kfree(pred->mask);
    -		}
    +			pred->mask = NULL;
     @@ kernel/trace/trace_events_filter.c: static int parse_pred(const char *str, void *data,
                                FILTER_PRED_FN_CPUMASK_CPU :
                                FILTER_PRED_FN_CPUMASK;
                } else if (field->filter_type == FILTER_CPU) {
     -			pred->fn_num = FILTER_PRED_FN_CPU_CPUMASK;
     +			if (single) {
    -+				pred->op = pred->op == OP_BAND ? OP_EQ : pred->op;
    ++				if (pred->op == OP_BAND)
    ++					pred->op = OP_EQ;
    ++
     +				pred->fn_num = FILTER_PRED_FN_CPU;
     +			} else {
     +				pred->fn_num = FILTER_PRED_FN_CPU_CPUMASK;
     +			}
                } else if (single) {
    -			pred->op = pred->op == OP_BAND ? OP_EQ : pred->op;
    -			pred->fn_num = select_comparison_fn(pred->op, field->size, false);
    +			if (pred->op == OP_BAND)
    +				pred->op = OP_EQ;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ