[Question] How can we use underscore "_" in sensor name?

Heyi Guo guoheyi at linux.alibaba.com
Sat Sep 18 12:38:48 AEST 2021


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 <patrick at stwcx.xyz> 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


More information about the openbmc mailing list