mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Tom Zanussi <zanussi@kernel.org>
Cc: rostedt@goodmis.org, axelrasmussen@google.com,
	mhiramat@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 7/7] selftests/ftrace: Add test case for synthetic event syntax errors
Date: Wed, 14 Oct 2020 11:06:36 +0900	[thread overview]
Message-ID: <20201014110636.139df7be275d40a23b523b84@kernel.org> (raw)
In-Reply-To: <af611928ce79f86eaf0af8654f1d7802d5cc21ff.1602598160.git.zanussi@kernel.org>

Hi Tom,

On Tue, 13 Oct 2020 09:17:58 -0500
Tom Zanussi <zanussi@kernel.org> wrote:

> Add a selftest that verifies that the syntax error messages and caret
> positions are correct for most of the possible synthetic event syntax
> error cases.
> 
> Signed-off-by: Tom Zanussi <zanussi@kernel.org>
> ---
>  .../trigger-synthetic_event_syntax_errors.tc  | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>  create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic_event_syntax_errors.tc
> 
> diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic_event_syntax_errors.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic_event_syntax_errors.tc
> new file mode 100644
> index 000000000000..ada594fe16cb
> --- /dev/null
> +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic_event_syntax_errors.tc
> @@ -0,0 +1,19 @@
> +#!/bin/sh
> +# SPDX-License-Identifier: GPL-2.0
> +# description: event trigger - test synthetic_events syntax parser errors
> +# requires: synthetic_events error_log

This also requires dynamic strings support. So, its "requires" line should be

# requires: synthetic_events error_log "char name[]' >> synthetic_events":README

> +
> +check_error() { # command-with-error-pos-by-^
> +    ftrace_errlog_check 'synthetic_events' "$1" 'synthetic_events'
> +}
> +

BTW, some errors looks a bit odd.

> +check_error 'myevent ^chr arg'			# INVALID_TYPE
> +check_error 'myevent ^char str[];; int v'	# INVALID_TYPE

I think there is a wrong "void" argument between ";", instead of invalid type.

> +check_error 'myevent char ^str]; int v'		# INVALID_NAME
> +check_error 'myevent char ^str;[]'		# INVALID_NAME

This is also not an invalid name but '[]' is an invalid type. 

> +check_error 'myevent ^char str[; int v'		# INVALID_TYPE
> +check_error '^mye;vent char str[]'		# BAD_NAME
> +check_error 'myevent char str[]; ^int'		# INVALID_FIELD

Isn't it an incomplete command?

> +check_error '^myevent'				# INCOMPLETE_CMD
> +
> +exit 0

Thank you,

> -- 
> 2.17.1
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

  reply	other threads:[~2020-10-14  2:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-13 14:17 [PATCH v3 0/7] tracing: Synthetic event dynamic string fixes Tom Zanussi
2020-10-13 14:17 ` [PATCH v3 1/7] tracing: Don't show dynamic string internals in synthetic event description Tom Zanussi
2020-10-13 14:17 ` [PATCH v3 2/7] tracing: Move is_good_name() from trace_probe.h to trace.h Tom Zanussi
2020-10-13 14:17 ` [PATCH v3 3/7] tracing: Check that the synthetic event and field names are legal Tom Zanussi
2020-10-13 14:17 ` [PATCH v3 4/7] tracing: Add synthetic event error logging Tom Zanussi
2020-10-13 15:37   ` Steven Rostedt
2020-10-13 14:17 ` [PATCH v3 5/7] selftests/ftrace: Change synthetic event name for inter-event-combined test Tom Zanussi
2020-10-13 14:17 ` [PATCH v3 6/7] tracing: Handle synthetic event array field type checking correctly Tom Zanussi
2020-10-13 14:17 ` [PATCH v3 7/7] selftests/ftrace: Add test case for synthetic event syntax errors Tom Zanussi
2020-10-14  2:06   ` Masami Hiramatsu [this message]
2020-10-14 17:32     ` Steven Rostedt
2020-10-15  0:16       ` Masami Hiramatsu
2020-10-15 13:59     ` Tom Zanussi
2020-10-14  0:22 ` [PATCH v3 0/7] tracing: Synthetic event dynamic string fixes Masami Hiramatsu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201014110636.139df7be275d40a23b523b84@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=axelrasmussen@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=zanussi@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome