Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7818DC433EF for ; Sat, 18 Sep 2021 02:39:30 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 019BA611C8 for ; Sat, 18 Sep 2021 02:39:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 019BA611C8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4HBFQS2tC2z30GN for ; Sat, 18 Sep 2021 12:39:28 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.alibaba.com (client-ip=115.124.30.57; helo=out30-57.freemail.mail.aliyun.com; envelope-from=guoheyi@linux.alibaba.com; receiver=) Received: from out30-57.freemail.mail.aliyun.com (out30-57.freemail.mail.aliyun.com [115.124.30.57]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4HBFPv47cCz2yJL for ; Sat, 18 Sep 2021 12:38:57 +1000 (AEST) X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R101e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04394; MF=guoheyi@linux.alibaba.com; NM=1; PH=DS; RN=8; SR=0; TI=SMTPD_---0UojvBlV_1631932728; Received: from B-G4TALVDL-1650.local(mailfrom:guoheyi@linux.alibaba.com fp:SMTPD_---0UojvBlV_1631932728) by smtp.aliyun-inc.com(127.0.0.1); Sat, 18 Sep 2021 10:38:49 +0800 Subject: Re: [Question] How can we use underscore "_" in sensor name? To: Ed Tanous , Patrick Williams References: <3a702375-de87-985d-d096-7f187d293459@linux.alibaba.com> <2416388c-73fe-f4fd-8c1c-c98f9c93230c@intel.com> <1405025a-fbd8-f350-ae12-5bf94671ff87@linux.alibaba.com> From: Heyi Guo Message-ID: Date: Sat, 18 Sep 2021 10:38:48 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vernon Mauery , "openbmc@lists.ozlabs.org" , Tom Joseph , Oskar Senft , Johnathan Mantey , "Puli, Apparao" Errors-To: openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Sender: "openbmc" Hi Ed, That's great, and I'll be glad to test the patches on our platforms. Thanks, Heyi On 2021/9/16 上午12:35, Ed Tanous wrote: > On Wed, Sep 15, 2021 at 9:23 AM Patrick Williams wrote: >> On Wed, Sep 15, 2021 at 09:54:47AM -0400, Oskar Senft wrote: >>> +1 to using something more explicit, like %20 instead of "_" for >>> replacing " " for D-bus names. >> Ed had previously added code to sdbusplus to consistently do conversions like >> this, in the same way that systemd tends to do conversions. I think we just >> need to convert the affected repositories here to use these sdbusplus >> object_path types rather than creating their own strings. >> >> https://github.com/openbmc/sdbusplus/blob/master/src/message/native_types.cpp#L53 >> >> If paths are encoded this way, we are able to clearly differentiate between a >> desired space and an underscore because the spaces become encoded as something >> like `_20`, similar to the proposal here. > For what it's worth, I added this code to solve this exact problem > (although in my case I wanted to use dashes in sensor names) I just > haven't pushed the final sets of patches yet to turn it on. I'm glad > to see all the interest in this; I think the bulk of the hard work is > done, and all we should need is changesets pushed to bmcweb, > dbus-sensors, and ipmi-dynamic to use the operator/ and filename() > methods to construct the dbus paths. Keep in mind, IPMI will need > some escaping, as IPMI SDRs assume ASCII, and bmcweb will need to be > flushed through the urlencode method to ensure we're encoding our URIs > properly. > > If this is important to people, feel free to push and test the > patches, otherwise it's still on my list to get done and I'll CC this > thread when any new patchsets are pushed. > >> -- >> Patrick Williams