<div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 29, 2020 at 10:13 PM Harvey Wu (吳崇維) <<a href="mailto:Harvey.Wu@quantatw.com">Harvey.Wu@quantatw.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Vijay,<br>
<br>
        Because I want to calculate the different value between CriticalHigh and current sensor value in CPU sensor, and then there are weighting and some const value to multiply or plus the different value.<br>
But the CPU sensor critical high threshold temp is set as TjMax, and the TjMax value will be different according the different CPU process type, not a Const. That's why I want to add this feature.<br></blockquote><div><br></div><div>Yes I understand that critical values for cpus are received from CPUs and not a constant values.  But just for this specific sensor we should not add a new complex feature in a virtual sensor. Because every other sensor has constant threshold values defined by user so it won't be used anywhere else other than psu cpu sensor only.</div><div><br></div><div>I would rather expose TjMax on dbus if you really want to use this.further. So exposing tjmax would be easy and straightforward rather than adding this complex logic for only this sensor in a generic virtual sensor.  </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
For example, according the Document below, if the processor is i7-3770K, the TjMax is 105, and if the processor is U7500, the TjMax is 100.<br>
<a href="https://www.kernel.org/doc/Documentation/hwmon/coretemp.rst" rel="noreferrer" target="_blank">https://www.kernel.org/doc/Documentation/hwmon/coretemp.rst</a> <br>
<br>
If the Expression is "(TjMax - currentTemp) * scalar - Const", then it will calculate different results between these two CPU processor.<br>
<br>
<br>
Harvey Wu<br>
<br>
From: Vijay Khemka <<a href="mailto:vijaykhemkalinux@gmail.com" target="_blank">vijaykhemkalinux@gmail.com</a>> <br>
Sent: Wednesday, December 30, 2020 1:02 PM<br>
To: Harvey Wu (吳崇維) <<a href="mailto:Harvey.Wu@quantatw.com" target="_blank">Harvey.Wu@quantatw.com</a>><br>
Cc: Lei Yu <<a href="mailto:yulei.sh@bytedance.com" target="_blank">yulei.sh@bytedance.com</a>>; <a href="mailto:openbmc@lists.ozlabs.org" target="_blank">openbmc@lists.ozlabs.org</a><br>
Subject: Re: [phosphor-virtual-sensor] Add new feature to get Warning or Critical property<br>
<br>
I am not understanding why you want to use threshold values to calculate new sensor values. We can certainly add this feature but it can not be based on name rather we have to think differently to get. It would really help to decide on design once we know it's actual usage. I can't think of any situation here.<br>
<br>
Regards<br>
-Vijay<br>
<br>
On Tue, Dec 29, 2020 at 6:49 PM Harvey Wu (吳崇維) <mailto:<a href="mailto:Harvey.Wu@quantatw.com" target="_blank">Harvey.Wu@quantatw.com</a>> wrote:<br>
> On Wed, Dec 30, 2020 at 10:19 AM Harvey Wu (吳崇維)<br>
> <mailto:<a href="mailto:Harvey.Wu@quantatw.com" target="_blank">Harvey.Wu@quantatw.com</a>> wrote:<br>
> ><br>
> > Hi All,<br>
> ><br>
> ><br>
> ><br>
> >         The current phosphor-virtual-sensor DbusParam value is from<br>
> DBus “Value” property which interface is<br>
> “xyz.openbmc_project.Sensor.Value”.<br>
> ><br>
> > Because I want to get the property “CriticalHigh” value on DBus, could I<br>
> add a new feature “Interface” property in json file? The property can be<br>
> “CriticalHigh” , “CriticalLow” , “WarningHigh” or “WarningLow”.<br>
> <br>
> <br>
> According to<br>
> <a href="https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub" rel="noreferrer" target="_blank">https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub</a>.<br>
> com%2Fopenbmc%2Fphosphor-virtual-sensor%2Fblob%2Fmaster%2Fvirtual_<br>
> sensor_config.json%23L8-L14&amp;data=04%7C01%7CHarvey.Wu%40quantat<br>
> <a href="https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fw.com%2F&data=04%7C01%7CHarvey.Wu%40quantatw.com%7Cf75707a7431e4dca712e08d8ac80182b%7C179b032707fc4973ac738de7313561b2%7C1%7C0%7C637449013448979318%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=kxT3i6moVPggqbY1zJiag18Cp9wGmyk1ctqrO8XlTUc%3D&reserved=0%7C1479ebd5aedd4b8a7c3308d8ac6a4393%7C179b032707fc4973ac73" rel="noreferrer" target="_blank">https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fw.com%2F&data=04%7C01%7CHarvey.Wu%40quantatw.com%7Cf75707a7431e4dca712e08d8ac80182b%7C179b032707fc4973ac738de7313561b2%7C1%7C0%7C637449013448979318%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=kxT3i6moVPggqbY1zJiag18Cp9wGmyk1ctqrO8XlTUc%3D&reserved=0%7C1479ebd5aedd4b8a7c3308d8ac6a4393%7C179b032707fc4973ac73</a><br>
> 8de7313561b2%7C1%7C0%7C637448919693850853%7CUnknown%7CTWFpb<br>
> GZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6<br>
> Mn0%3D%7C1000&amp;sdata=0KyrnRkZKr9M59DEg%2BnyUruiege%2B3EDXb<br>
> mxzR%2B6xeng%3D&amp;reserved=0,<br>
> the threshold properties are already supported.<br>
<br>
The "Threshold" in json seems only can set the sensor critical or warning value, but I want to use the critical or warning value in "Expression".<br>
After check the newest commit, this function seems doesn't implement in current source code.<br>
<br>
> <br>
> --<br>
> BRs,<br>
> Lei YU<br>
<br>
<br>
Harvey Wu<br>
</blockquote></div></div></div>