Received: by 2002:ab2:f03:0:b0:1ef:ffd0:ce49 with SMTP id i3csp21784lqf; Tue, 26 Mar 2024 13:00:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVe6Hwu0Y6LWsIQqIP9DmpdSDJOUIXCN5FdHQOU22t0WzeJSEjypiNECYwq0Vdj7hpn/uibbtAbM1vaCHL9UxA1CFYkQbSEAeXkFNayFw== X-Google-Smtp-Source: AGHT+IFnYnbmApCm1D+0bsI0kzH/FZTxmP1M4PFOOXEQ47y2EP80kyCpYTHNH5oHLggH7HYm9T5P X-Received: by 2002:a5b:5c7:0:b0:dc6:421a:3024 with SMTP id w7-20020a5b05c7000000b00dc6421a3024mr8773754ybp.43.1711483240020; Tue, 26 Mar 2024 13:00:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711483240; cv=pass; d=google.com; s=arc-20160816; b=A+OtXBWugkRuz3fF1Ri2jcrbvXsKt1lYEGokVhXh5u4HcplRCFCVQ94fjpELn8tlcB tgqkE18udxpE1rqqR7408FHAxAhLCOQYtY+cDizr33BXkmdFMiZxKtnWmbKDAiMefTWk CKVSTrGQ7yVkzCGDbv6rfHPSsFAHX0e0MbYkkLt9EutUmR49WN9qIMgYajim5WHsDO/5 /fj1pHliymxyZo+OgDhfvCJ5aWhWZcvFdVhElTUqvdUUcZ2nvJEOxeX2qvyNe6D7OuPV CcZZAAN1zANapT836fikCnG7APyZsQOrkbhqbDVxYOUYEBfgjnbmVoP55+FBbrZHDcK6 kP6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=IdQUORm6h0uikhJa7u6bme4vQj7H+328dVXDreC5A9Y=; fh=96WighV+wflEiV2L2I8P4Nl4tZk9Igmpmr9/zsAnoug=; b=F7uBp3oEkWaqAKwUza8hZhmvwspaNMm86z7TDALOSNqwR8MrK2ccNsBm8fe6eq5Szp A9igQ6EguAs72ZO36iAENn5iXQhtDo0wFmKDAo8Scyu1xI8vuDOHrfVtxoBaXftuV1X+ Q7Tf9nN+K3GtZbfNZELf5jhFFusASRJkNgVXri3l9G/uw7x+rG2mUEKg6K4Y78raFWDv 8CvAXox+ZscLBHA7qtsPFlIrNODgYXgvMzvB1vmQsn/t2CEWxytIi/A/2PPa+siw+uy8 AWBLw3kBLxdRUNlLWzds0Vaar50qLesVAwC9Ht15seWrxdjqFnV/9/HJ3hhKmGZ31DL9 e3xw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=VS41cHi5; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linuxfoundation.org dmarc=pass fromdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-119851-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119851-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id r14-20020a0562140c4e00b006961178758asi11008808qvj.221.2024.03.26.13.00.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 13:00:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-119851-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=VS41cHi5; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linuxfoundation.org dmarc=pass fromdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-119851-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119851-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id AE1C41C62B5A for ; Tue, 26 Mar 2024 20:00:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 63D3113D287; Tue, 26 Mar 2024 20:00:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="VS41cHi5" Received: from mail-il1-f175.google.com (mail-il1-f175.google.com [209.85.166.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B2C4D13D265 for ; Tue, 26 Mar 2024 20:00:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711483233; cv=none; b=CfAmMCYeixW4tRtxm27ggz0AgmXnRrdvQZD8Fi56C6D31KpiaDzEy9nLClnm5dJV7du82X0ehV0JE9brprx2T6Ob5y3ZCPWrR6KHEstJMs8bws8pD5+gKlJc08c2giHwWOkFTcByfZpjSr9ahBlB7POovGB7ZkvZsZbuLomcVRw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711483233; c=relaxed/simple; bh=Unzp8uuNQUgKN7Bb79LPIlxYgOk5ijtgyJbVOjBp7gc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=s8WGW4nup2DNkyEuXjbblgIfXX1jt8v8TTEDOExjf8P1XOokcu7mpvsd1wztA3me5rIr+72tv+LQtGf2+yUEPJFCpQUchDOplk7ykBZTApunoYI31acgRH2RAvO2ZtqgemVVMKxQ8zg+zlx4Fpb8ogGdD52SGbvkyXVPNU6OaxI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=VS41cHi5; arc=none smtp.client-ip=209.85.166.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Received: by mail-il1-f175.google.com with SMTP id e9e14a558f8ab-3688dcc5055so468185ab.1 for ; Tue, 26 Mar 2024 13:00:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1711483231; x=1712088031; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=IdQUORm6h0uikhJa7u6bme4vQj7H+328dVXDreC5A9Y=; b=VS41cHi58CLDrYRSPfSNyKQZnjLbs9fe3UUtzE3gsTBTwO5JxQ5UZlC08JMUe7gJTb OR8s6eUiifNP9JcNXeoVioLP08kZqKCGBHq7ncIEJIUo+Yu0gphxHuriEUMK9pQX7aVt D25LNi5463b669NGqRdXgxnbKdS6ocswz4hhA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711483231; x=1712088031; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IdQUORm6h0uikhJa7u6bme4vQj7H+328dVXDreC5A9Y=; b=on7pf7Owm68q57ZY9dSdlMPVhYK0O3DPkthA1F9Kmf2Ou6xA5uQ1SUzlAf6ZQ4r9c/ YydSIiwUSuYpUsEYydQqMj2YLJzE6zzJpg6/JWdNqNSH4fSUhtRRxb5feePxOPJP/qDd /V+S1XlwFKTHNbZvmLKWPeMfGZVLgrb1XMfJ6gGrHQzWW+bOGkhyxsD2YfX3lGgJHplr p418XI4ZDRR7G+OkjgLFWIMc9MWfWUU8LTo2nqDwxbDpICpYp1flo0D+D/1zoLm7Tzvu V0LtbEzjtxM5ASP9f/k3ggKyigz8Nxo0brwcWFyKZ0aEEzsIiYTM+XAk0EW3ohcL8LPo zXUQ== X-Forwarded-Encrypted: i=1; AJvYcCXYK2cqEV7mvE1wySor01F8cxEhBNLH+2RafvqJ/K1KZwpvAO3j5nw4JMJVtr/riI11d9ok1kWQeJOei67b5FMlyT47cZN2sNeJ2LKA X-Gm-Message-State: AOJu0YzJGT2hmkfbiD5JbgSOiUyBJTbeb8gumK6mxxiD5DtBv4VfFEcm k+QpJle6hbLXZepY3oYiHOp1A/y404wtXx4JP6AAB4m0oXAUSbMdikxMhthAGxA= X-Received: by 2002:a05:6e02:1fea:b0:368:a043:4a26 with SMTP id dt10-20020a056e021fea00b00368a0434a26mr3573431ilb.3.1711483230718; Tue, 26 Mar 2024 13:00:30 -0700 (PDT) Received: from [192.168.1.128] ([38.175.170.29]) by smtp.gmail.com with ESMTPSA id j12-20020a926e0c000000b00366a3016a30sm3105612ilc.70.2024.03.26.13.00.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 26 Mar 2024 13:00:30 -0700 (PDT) Message-ID: Date: Tue, 26 Mar 2024 14:00:29 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] selftests: x86: test_vsyscall: conform test to TAP format output Content-Language: en-US To: Muhammad Usama Anjum , Shuah Khan Cc: kernel@collabora.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan References: <20240314103216.286603-1-usama.anjum@collabora.com> From: Shuah Khan In-Reply-To: <20240314103216.286603-1-usama.anjum@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 3/14/24 04:32, Muhammad Usama Anjum wrote: > Conform the layout, informational and status messages to TAP. No > functional change is intended other than the layout of output messages. > Without using TAP messages, the passed/failed/skip test names cannot be > found. > > Signed-off-by: Muhammad Usama Anjum > --- I am seeing lot more changes than conform and formatting changes. > tools/testing/selftests/x86/test_vsyscall.c | 506 +++++++++----------- > 1 file changed, 238 insertions(+), 268 deletions(-) > > diff --git a/tools/testing/selftests/x86/test_vsyscall.c b/tools/testing/selftests/x86/test_vsyscall.c > index 47cab972807c4..d4c8e8d79d389 100644 > --- a/tools/testing/selftests/x86/test_vsyscall.c > +++ b/tools/testing/selftests/x86/test_vsyscall.c > @@ -21,6 +21,13 @@ > #include > > #include "helpers.h" > +#include "../kselftest.h" > + > +#ifdef __x86_64__ > +#define TOTAL_TESTS 13 > +#else > +#define TOTAL_TESTS 8 > +#endif > > #ifdef __x86_64__ > # define VSYS(x) (x) > @@ -39,18 +46,6 @@ > /* max length of lines in /proc/self/maps - anything longer is skipped here */ > #define MAPS_LINE_LEN 128 > > -static void sethandler(int sig, void (*handler)(int, siginfo_t *, void *), > - int flags) > -{ > - struct sigaction sa; > - memset(&sa, 0, sizeof(sa)); > - sa.sa_sigaction = handler; > - sa.sa_flags = SA_SIGINFO | flags; > - sigemptyset(&sa.sa_mask); > - if (sigaction(sig, &sa, 0)) > - err(1, "sigaction"); > -} > - Why is this deleted? > /* vsyscalls and vDSO */ > bool vsyscall_map_r = false, vsyscall_map_x = false; > > @@ -75,83 +70,25 @@ static void init_vdso(void) > if (!vdso) > vdso = dlopen("linux-gate.so.1", RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD); > if (!vdso) { > - printf("[WARN]\tfailed to find vDSO\n"); > + ksft_print_msg("[WARN] failed to find vDSO\n"); > return; > } > > vdso_gtod = (gtod_t)dlsym(vdso, "__vdso_gettimeofday"); > if (!vdso_gtod) > - printf("[WARN]\tfailed to find gettimeofday in vDSO\n"); > + ksft_print_msg("[WARN] failed to find gettimeofday in vDSO\n"); > > vdso_gettime = (vgettime_t)dlsym(vdso, "__vdso_clock_gettime"); > if (!vdso_gettime) > - printf("[WARN]\tfailed to find clock_gettime in vDSO\n"); > + ksft_print_msg("[WARN] failed to find clock_gettime in vDSO\n"); > > vdso_time = (time_func_t)dlsym(vdso, "__vdso_time"); > if (!vdso_time) > - printf("[WARN]\tfailed to find time in vDSO\n"); > + ksft_print_msg("[WARN] failed to find time in vDSO\n"); > > vdso_getcpu = (getcpu_t)dlsym(vdso, "__vdso_getcpu"); > if (!vdso_getcpu) > - printf("[WARN]\tfailed to find getcpu in vDSO\n"); > -} > - > -static int init_vsys(void) > -{ > -#ifdef __x86_64__ > - int nerrs = 0; > - FILE *maps; > - char line[MAPS_LINE_LEN]; > - bool found = false; > - > - maps = fopen("/proc/self/maps", "r"); > - if (!maps) { > - printf("[WARN]\tCould not open /proc/self/maps -- assuming vsyscall is r-x\n"); > - vsyscall_map_r = true; > - return 0; > - } > - > - while (fgets(line, MAPS_LINE_LEN, maps)) { > - char r, x; > - void *start, *end; > - char name[MAPS_LINE_LEN]; > - > - /* sscanf() is safe here as strlen(name) >= strlen(line) */ > - if (sscanf(line, "%p-%p %c-%cp %*x %*x:%*x %*u %s", > - &start, &end, &r, &x, name) != 5) > - continue; > - > - if (strcmp(name, "[vsyscall]")) > - continue; > - > - printf("\tvsyscall map: %s", line); > - > - if (start != (void *)0xffffffffff600000 || > - end != (void *)0xffffffffff601000) { > - printf("[FAIL]\taddress range is nonsense\n"); > - nerrs++; > - } > - > - printf("\tvsyscall permissions are %c-%c\n", r, x); > - vsyscall_map_r = (r == 'r'); > - vsyscall_map_x = (x == 'x'); > - > - found = true; > - break; > - } > - > - fclose(maps); > - > - if (!found) { > - printf("\tno vsyscall map in /proc/self/maps\n"); > - vsyscall_map_r = false; > - vsyscall_map_x = false; > - } > - > - return nerrs; > -#else > - return 0; > -#endif > + ksft_print_msg("[WARN] failed to find getcpu in vDSO\n"); > } > What's going on here? These changes are more extensive than the changelog indicates. Additional explanation is needed before I can accept this. thanks, -- Shuah