Linux Test Project
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v3] syscalls/prctl05.c: New test for prctl() with PR_{SET, GET}_NAME
Date: Fri, 24 May 2019 15:48:49 +0200	[thread overview]
Message-ID: <20190524134849.GB2251@rei> (raw)
In-Reply-To: <b6b85048-ff36-9681-05bd-2131721efd4f@163.com>

Hi!
> > +	if (strcmp(tc->expname, buf))
> > +		tst_res(TFAIL,
> > +			"prctl(PR_GET_NAME) failed ,expected %s, got %s", tc->expname, buf);
> > +	else
> > +		tst_res(TPASS,
> > +			"prctl(PR_GET_NAME) succeeded, thread name is %s", buf);
> Hi Xu,
> 
> It is not necessary to continue if buf mismatches tc->expname.
> 
> > +
> > +	tid = tst_syscall(__NR_gettid);
> > +
> > +	sprintf(PROC_NAME_PATH, "/proc/self/task/%d/comm", tid);
> > +	SAFE_FILE_SCANF(PROC_NAME_PATH, "%s", comm_buf);
> 
> You didn't create multiple threads here so it seems simpler to use 
> /proc/self/comm
> instead of /proc/self/task/<tid>/comm. do you think so?
> Please see the following url for details:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/proc.txt

Actually we should check both.

> BTW:
> Should we print three TPASS messages for one test?
> Can we replace previous TPASS with TINFO and then print TPASS at the end?

I think that it's cleaner to print PASS/FAIL message for each subtest.

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2019-05-24 13:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-09 12:20 [LTP] [PATCH] syscalls/prctl05.c: New test for prctl() with PR_{SET, GET}_NAME Yang Xu
2019-05-22 10:16 ` xuyang
2019-05-23  9:40 ` Cyril Hrubis
2019-05-23 11:35   ` [LTP] [PATCH v2] " Yang Xu
2019-05-23 11:51     ` Xiao Yang
2019-05-24  7:36       ` xuyang
2019-05-24  7:50       ` [LTP] [PATCH v3] " Yang Xu
2019-05-24 13:21         ` Cyril Hrubis
2019-05-24 13:45         ` Xiao Yang
2019-05-24 13:48           ` Cyril Hrubis [this message]
2019-05-24 13:58             ` Xiao Yang
2019-05-27  8:19               ` [LTP] [PATCH v4] " Yang Xu
2019-05-27 13:41                 ` Cyril Hrubis

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=20190524134849.GB2251@rei \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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