Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp276433rwb; Fri, 2 Sep 2022 14:03:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR5cHoBk7Ymu9N57QlR2itIZ+JuGQ3QTR2CCGB6BaN28mGE9oRH6tR6oyPr0qgwecYm72JJ2 X-Received: by 2002:a17:907:2da6:b0:73d:d587:6213 with SMTP id gt38-20020a1709072da600b0073dd5876213mr27995625ejc.5.1662152621196; Fri, 02 Sep 2022 14:03:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662152621; cv=none; d=google.com; s=arc-20160816; b=WFTtK2icY1cO6Y20HOUMzXnmE3ODwV45jmz1rxeP5br+vVUtKiXwyus+09jYOd+NLo pDKFVc/p7OcN8K0Ggd+vf/k7BomvbqsiMbzgmesVtIxsU9fLrab6CKodRvRq/d9/ZpDH n0g2PQdQlA0024xL9Ukmm/EOnPpTq+EWHuViQQpGNPYGMLwQAnuNuX3L2EEFtUWqa1W6 /msN1MRScSqYFn0W0fEGaEeH5gthLcv+4B2nM8sV+YwKb2f8BG5RU2AVZ4D9/rFr7VOZ ToY/ZSxcVODh9xJOrGdO0usRlCEbLnKCGRQvQQYPjWqyWBbC2cpxnOwRO/M0IU7XIqGm 2h3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=GQRIyu5OW7Fo/yea+p5edNhj+s5RHy0RzGsjcxsAkPc=; b=d9runnPVeJX+WvvOW7rxu1vm95JNOIiCzycuLGJE84whLON8KfJzF3HpJj5URISeAL IYkbOdngUxhbTixJuuBLIkssF49k1v4rWm4MPCPuh4qCiD1MUzCx/AmYwNqvXDi+I0K4 eNH5mcLiBwcBbQKonDFgQz0JPw2/SBvJs/7aGMxsQkhV0VN8M/9PKNPzUtf/LEGDe7Xm q6HHh68VBED42yhCwlu2PU/GauRycdbwTVnwMy0wX32AMdjhIsHEtOif/rgSAUnnD7d+ /Z6SzbbNJdhsvzswgejm1IGNnce/IlG8oTCCVZOC+kWln3scZdMncaNJhdGBCjl7g5xD 8vAw== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p24-20020a50cd98000000b0044882fc9940si2182354edi.569.2022.09.02.14.03.14; Fri, 02 Sep 2022 14:03:41 -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; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230329AbiIBUwb convert rfc822-to-8bit (ORCPT + 99 others); Fri, 2 Sep 2022 16:52:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229685AbiIBUw3 (ORCPT ); Fri, 2 Sep 2022 16:52:29 -0400 Received: from mx0b-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDD5EFCA3A for ; Fri, 2 Sep 2022 13:52:28 -0700 (PDT) Received: from pps.filterd (m0109331.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 282JNaAb016796 for ; Fri, 2 Sep 2022 13:52:28 -0700 Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3jb9q8vqpu-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 02 Sep 2022 13:52:27 -0700 Received: from twshared10425.14.frc2.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:82::e) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 2 Sep 2022 13:52:26 -0700 Received: by devbig932.frc1.facebook.com (Postfix, from userid 4523) id 8620EC63D68A; Fri, 2 Sep 2022 13:52:14 -0700 (PDT) From: Song Liu To: , CC: , , , , , Song Liu Subject: [PATCH v3 0/2] add sysfs entry "patched" for each klp_object Date: Fri, 2 Sep 2022 13:52:06 -0700 Message-ID: <20220902205208.3117798-1-song@kernel.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT X-FB-Internal: Safe Content-Type: text/plain X-Proofpoint-ORIG-GUID: v39Yt6SETZ0TLv4qQ8RJxUjujuTFE4uO X-Proofpoint-GUID: v39Yt6SETZ0TLv4qQ8RJxUjujuTFE4uO X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-09-02_05,2022-08-31_03,2022-06-22_01 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 I was debugging an issue that a livepatch appears to be attached, but actually not. It turns out that there is a mismatch in module name (abc-xyz vs. abc_xyz), klp_find_object_module failed to find the module. Add a sysfs entry for each klp_object, so that it is easier to debug such issues. Changes v2 => v3: 1. Improve selftest. (Petr Mladek and Joe Lawrence) Changes v1 => v2: 1. Add selftest. (Petr Mladek) 2. Update documentation. (Petr Mladek) 3. Use sysfs_emit. (Petr Mladek) Song Liu (2): livepatch: add sysfs entry "patched" for each klp_object selftests/livepatch: add sysfs test .../ABI/testing/sysfs-kernel-livepatch | 8 ++ kernel/livepatch/core.c | 18 ++++ tools/testing/selftests/livepatch/Makefile | 3 +- .../testing/selftests/livepatch/functions.sh | 34 ++++++++ .../testing/selftests/livepatch/test-sysfs.sh | 86 +++++++++++++++++++ 5 files changed, 148 insertions(+), 1 deletion(-) create mode 100755 tools/testing/selftests/livepatch/test-sysfs.sh -- 2.30.2