public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: John Kacur <jkacur@redhat.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-rt-users@vger.kernel.org,
	Clark Williams <williams@redhat.com>,
	Daniel Wagner <wagi@monom.org>
Subject: Re: [PATCH 2/5] signaltest: Remove drunk code
Date: Tue, 10 Nov 2020 15:07:19 -0500 (EST)	[thread overview]
Message-ID: <66cc4498-e7d0-4e33-9efd-8f60c1d13edb@redhat.com> (raw)
In-Reply-To: <20201110180036.859080-3-bigeasy@linutronix.de>



On Tue, 10 Nov 2020, Sebastian Andrzej Siewior wrote:

> `oldtrace' is set for kernels prior 2.6.18. Remove "support" for them.
> 
> The alternative code (for new kernels) issues
> 	prctl(0, [01]);
> 
> which is not valid the kernel returns an error. I have no idea what its
> purpose is, remove it.
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
>  src/signaltest/signaltest.c | 29 -----------------------------
>  1 file changed, 29 deletions(-)
> 
> diff --git a/src/signaltest/signaltest.c b/src/signaltest/signaltest.c
> index 1cc3236a8f377..aceb714d3e9d3 100644
> --- a/src/signaltest/signaltest.c
> +++ b/src/signaltest/signaltest.c
> @@ -62,7 +62,6 @@ struct thread_stat {
>  
>  static int shutdown;
>  static int tracelimit;
> -static int oldtrace;
>  
>  
>  /*
> @@ -105,13 +104,6 @@ void *signalthread(void *param)
>  
>  	stat->threadstarted++;
>  
> -	if (tracelimit) {
> -		if (oldtrace)
> -			gettimeofday(0, (struct timezone *)1);
> -		else
> -			prctl(0, 1);
> -	}
> -
>  	clock_gettime(CLOCK_MONOTONIC, &before);
>  
>  	while (!shutdown) {
> @@ -152,10 +144,6 @@ void *signalthread(void *param)
>  
>  		if (!stopped && tracelimit && (diff > tracelimit)) {
>  			stopped++;
> -			if (oldtrace)
> -				gettimeofday(0, 0);
> -			else
> -				prctl(0, 0);
>  			shutdown++;
>  		}
>  		stat->act = diff;
> @@ -260,21 +248,6 @@ static void process_options(int argc, char *argv[])
>  		display_help(error);
>  }
>  
> -static void check_kernel(void)
> -{
> -	size_t len;
> -	char ver[256];
> -	int fd, maj, min, sub;
> -
> -	fd = open("/proc/version", O_RDONLY, 0666);
> -	len = read(fd, ver, 255);
> -	close(fd);
> -	ver[len-1] = 0x0;
> -	sscanf(ver, "Linux version %d.%d.%d", &maj, &min, &sub);
> -	if (maj == 2 && min == 6 && sub < 18)
> -		oldtrace = 1;
> -}
> -
>  static void sighand(int sig)
>  {
>  	shutdown = 1;
> @@ -323,8 +296,6 @@ int main(int argc, char **argv)
>  			goto out;
>  		}
>  
> -	check_kernel();
> -
>  	sigemptyset(&sigset);
>  	sigaddset(&sigset, signum);
>  	sigprocmask(SIG_BLOCK, &sigset, NULL);
> -- 
> 2.29.2
> 
> 
Signed-off-by: John Kacur <jkacur@redhat.com>

  reply	other threads:[~2020-11-10 20:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-10 18:00 [PATCH 0/5] rt-tests: Mostly signaltest clean up Sebastian Andrzej Siewior
2020-11-10 18:00 ` [PATCH 1/5] cyclictest: Only report the first incident Sebastian Andrzej Siewior
2020-11-10 20:06   ` John Kacur
2020-11-10 18:00 ` [PATCH 2/5] signaltest: Remove drunk code Sebastian Andrzej Siewior
2020-11-10 20:07   ` John Kacur [this message]
2020-11-10 18:00 ` [PATCH 3/5] signaltest: Don't expect trace interface at /proc Sebastian Andrzej Siewior
2020-11-10 20:07   ` John Kacur
2020-11-10 18:00 ` [PATCH 4/5] signaltest: Fix break value argument Sebastian Andrzej Siewior
2020-11-10 20:08   ` John Kacur
2020-11-10 18:00 ` [PATCH 5/5] signaltest: Add tracing bits Sebastian Andrzej Siewior

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=66cc4498-e7d0-4e33-9efd-8f60c1d13edb@redhat.com \
    --to=jkacur@redhat.com \
    --cc=bigeasy@linutronix.de \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=wagi@monom.org \
    --cc=williams@redhat.com \
    /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