Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3348753rwd; Sat, 10 Jun 2023 06:13:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4pLmW1/3ap8rj9Fe0Wkw3ztN7yI9b+lhoZWO2w2S49R1C/cfldX+7T+3NDY6Mim08UZYMS X-Received: by 2002:a17:907:9285:b0:96f:912e:5ec4 with SMTP id bw5-20020a170907928500b0096f912e5ec4mr3963082ejc.16.1686402798474; Sat, 10 Jun 2023 06:13:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686402798; cv=none; d=google.com; s=arc-20160816; b=XL4i2P2zn5GB3lbbHgG6SmVn/Fichbuz8asEeXL0rWy7K7p6E5+2qHycfnq+urNbJl qh61THzEBvo/IekrVcV+pGLkZn+pOLojueXHvkD7LK02iKMmAqNic+h/Aiye/NcoylCA fbNFFyyhEsgX/zzQ0WIHZDpstykXjs3dBwk7Tmn0GJA5YGquGUjvAl5pGUAHjmCmyvMG 8NSNniLN1UQWkDe3vptXzzk5UBRKK3QR7HDGfhkVrx7CZnJQJM/HgCTBSKFl8GVyBTbj 3MlH65A1VMu2uu8BtdyZXeQe4rdI7VKcamXmJRPF6yoIYp4gdxnz/FFIUupNSCPAXKnJ Tb1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=sid9PPnebkV661LCkg884rwv7/EfHsWnCoqGwZtAuUM=; b=W19BrGXCr87YHK63/NO1Qpanwld5AQSL2jHKlBm5A0dsM6wS9dUHumHzrBCSS5ZE0X ezIBQazQun+MsiwwWs4OO0KadXbuqt0Fl2/OmgG7fLEIH3pMI20ZpjgGS86uF/CBZTFD N1oJz8+SggbMiiVFnUdewkdd8jRImjjtYHlF9uw4MCV9E+FCv0gwMnDau9KRGjMEWX+4 q4ZSh+skMxAGebrIVDc+PKKXMsUHNchl3tTwikq4EKglj4DpveqOJgI+9avZkyySWnUg Rn1xit3DBLXx5SNiretYWmdOJpfCDuYHAM1lduCK3Frl6LFeO8POzNQmnWkpQnKwE5bo CeWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=fhxZj4Ok; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o6-20020a056402038600b005162dcb3e75si3779285edv.36.2023.06.10.06.12.54; Sat, 10 Jun 2023 06:13:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=fhxZj4Ok; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234424AbjFJNCG (ORCPT + 99 others); Sat, 10 Jun 2023 09:02:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229749AbjFJNCF (ORCPT ); Sat, 10 Jun 2023 09:02:05 -0400 Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6E2D3AB5; Sat, 10 Jun 2023 06:02:03 -0700 (PDT) Received: by mail-qt1-x835.google.com with SMTP id d75a77b69052e-3f9b7345fb1so21319611cf.1; Sat, 10 Jun 2023 06:02:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686402123; x=1688994123; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=sid9PPnebkV661LCkg884rwv7/EfHsWnCoqGwZtAuUM=; b=fhxZj4OkS8aCcj55qX+CEOfaluClflEKfym7Jqt7izDQ98GoAzcgVfN8X6JMvooPZK 0ta/WHHbhJEfBXjb1+e3wXKlw736PQX3wYQWAXt5z8cUL5snHW8aSouxy/cacofEfXWA c39ENWDsvlInvQupPQ8aTho52yKUyt8OibHo7uMR1AFG/vX4MA2/jyC/kJoiclI6MdRn 11LRm4iSyPaBmRQ+C3ahGdej2hrrs2LS/dj9oJszuK8SoNwxqGD2aL2hkXJflXoLZRcM kjlrnbW+NZbwQv3NzMHbLArhwUDsMVc1TZI36Ib4cJnsX4n5rN8KuUCMfioBukQAw/ak PUSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686402123; x=1688994123; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sid9PPnebkV661LCkg884rwv7/EfHsWnCoqGwZtAuUM=; b=cq20WDFAOUY/w38uPUvgndBJIltTad/3142JUFvQ8zfoyE9/BsLKVtX3x3MRVrr8Qb uCNObSPWuNrZJCKzEMC2EWZ21IdMfM7cn+zJbBCn13wE0v6f5S3kLpgIdDEf8LqONZRr vz2Uyx5KePkYCzosJuzdt16I78b1yLx7MgKC1ibN/n64sfNzxRf8jA1CdLhO9/97ujUt HOVhGKHjTgDPz4W9/YqBVsA9cXw0rsXsXyoHrx+3O4ZYTU4edY1kAywEoITF3f7a/Zf5 /IaqF0kPE+Q6FXxw/r/lcMQzgOOGm0YQXA/rrPLOhYkJwDX2/IraBOVJQ8eXjos1SyL3 EgWw== X-Gm-Message-State: AC+VfDxpnLfF+WD1TJVdQy52v0TJpD98HdzmlD86KdzfcMxqK4oVJRTl oYSNjKs+mpECpQjm3GSCyQj6D+eHgsJSLyXppFmc1TOEO2Y= X-Received: by 2002:a05:6214:268e:b0:621:78a:dd84 with SMTP id gm14-20020a056214268e00b00621078add84mr5238735qvb.47.1686402122252; Sat, 10 Jun 2023 06:02:02 -0700 (PDT) MIME-Version: 1.0 References: <20230607153600.15816-1-osmtendev@gmail.com> In-Reply-To: From: Osama Muhammad Date: Sat, 10 Jun 2023 18:01:51 +0500 Message-ID: Subject: Re: [PATCH v2] selftests: prctl: Add new prctl test for PR_SET_NAME To: Shuah Khan Cc: shuah@kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, I looked into it and tried to use TASK_COMM_LEN in the test. Even though I included "linux/sched.h '', I was not able to compile the test because it couldn't find it in the header file. I dived deep into the issue and turns out header file mapped in /usr/include/linux/sched.h is actually mapped to /include/uapi/linux/sched.h[1] in linux source, where TASK_COMM_LEN is not even defined. Instead TASK_COMM_LEN is defined in /include/linux/sched.h which is not mapped to any header files in userspace(/(/usr/include/linux). I also tried to find the TASK_COM_LEN in /usr/include/linux/ but I couldn't find it. Following are the search results. grep -rnw '/usr/include/linux/' -e 'TASK_COMM_LEN" RESULTS OF COMMAND :- /usr/include/linux/taskstats.h:38:#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN Based on this information, I have two questions: 1. Would this require a fix to move 'TASK_COMM_LEN' macro from /include/linux/sched.h to UAPI headers /include/uapi/linux/sched.h. 2. Is there any other way to access TASK_COMM_LEN in the selftest that I'm not aware of? [1]:-https://elixir.bootlin.com/linux/v5.15.116/source/include/uapi/linux/sched.h Thanks, Osama On Sat, 10 Jun 2023 at 02:43, Shuah Khan wrote: > > On 6/7/23 09:36, Osama Muhammad wrote: > > This patch will add the new test, which covers the prctl call > > PR_SET_NAME command. The test tries to give a name using the PR_SET_NAME > > call and then confirm it that it changed correctly by using PR_GET_NAME. > > It also tries to rename it with empty name.In the test PR_GET_NAME is > > tested by passing null pointer to it and check its behaviour. > > > > Signed-off-by: Osama Muhammad > > > > --- > > changes since v1: > > -Used TASK_COMM_LEN instead of using numerical value 16. > > Please add linux/sched.h here as an include to pull this. > It is good to add an explicit include as opposed taking > a chance on it being included from another include. > > thanks, > -- Shuah