History log of /openbmc/phosphor-host-ipmid/scripts/writesensor.mako.cpp (Results 1 – 25 of 25)
Revision Date Author Comments
# a23af120 15-Aug-2022 Jian Zhang <zhangjian.3032@bytedance.com>

Add init_priority to generated code

Fix a issue(crash) on `FEATURE_SENSORS_CACHE` is enabled.
As below backtrace:
```
...
4 0x75ff9a34 in initSensorMatches () at ../../../../../../workspace/sources

Add init_priority to generated code

Fix a issue(crash) on `FEATURE_SENSORS_CACHE` is enabled.
As below backtrace:
```
...
4 0x75ff9a34 in initSensorMatches () at ../../../../../../workspace/sources/phosphor-ipmi-host/sensorhandler.cpp:153
5 0x75f887a8 in register_netfn_sen_functions () at ../../../../../../workspace/sources/phosphor-ipmi-host/sensorhandler.cpp:1561
...
```

This issue is caused by `ipmi::sensor::sensors` is not initialized when
register_netfn_sen_functions is called.
Add init_priority to generated code to fix this issue.

Tested: Build okay and no crash.

Signed-off-by: Jian Zhang <zhangjian.3032@bytedance.com>
Change-Id: Ic5cc96206f3df9fafa10bbfb88c0bb4459749575

show more ...


# 11d68897 20-Jan-2022 Willy Tu <wltu@google.com>

cleanup: Remove all warning errors for the Meson build support

Remove all the build warning to prepare for the meson build.
Meson build will be in
https://gerrit.openbmc-project.xyz/c/openbmc/phosph

cleanup: Remove all warning errors for the Meson build support

Remove all the build warning to prepare for the meson build.
Meson build will be in
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-host-ipmid/+/47748

Tested:
Ipmi command works fine the cleanup.
```
$ systemctl status phosphor-ipmi-host
● phosphor-ipmi-host.service - Phosphor Inband IPMI
Loaded: loaded (/lib/systemd/system/phosphor-ipmi-host.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 1970-01-08 21:20:56 UTC; 21s ago
Main PID: 24987 (ipmid)
CGroup: /system.slice/phosphor-ipmi-host.service
└─24987 /tmp/ipmid

Jan 08 21:20:56 $HOST ipmid[24987]: Registering OEM:[0X002B79], Cmd:[0X30] for Ethstats Commands
Jan 08 21:20:56 $HOST ipmid[24987]: Registering OEM:[0X00C2CF], Cmd:[0X30] for Ethstats Commands
Jan 08 21:20:56 $HOST ipmid[24987]: Registering OEM:[0X002B79], Cmd:[0X32] for Sys Commands
Jan 08 21:20:56 $HOST ipmid[24987]: Registering OEM:[0X002B79], Cmd:[0X02] for I2C
Jan 08 21:20:56 $HOST ipmid[24987]: Registering OEM:[0X00C2CF], Cmd:[0X02] for I2C
Jan 08 21:20:56 $HOST ipmid[24987]: I2C_WHITELIST_CHECK is disabled, do not populate whitelist
Jan 08 21:20:56 $HOST ipmid[24987]: Registering OEM:[0X00C2CF], Cmd:[0X04] for Manual Zone Control
Jan 08 21:20:56 $HOST systemd[1]: Started Phosphor Inband IPMI.
Jan 08 21:20:56 $HOST ipmid[24987]: Loading whitelist filter
Jan 08 21:20:56 $HOST ipmid[24987]: Set restrictedMode = true
(reverse-i-search)`ipmi': systemctl status phosphor-^Cmi-host

$ ipmitool mc info
Device ID : 32
Device Revision : 1
Firmware Revision : 0.00
IPMI Version : 2.0
Manufacturer ID : 7244
Manufacturer Name : Quanta Computer Inc.
Product ID : 14426 (0x385a)
Product Name : Unknown (0x385A)
Device Available : yes
Provides Device SDRs : yes
Additional Device Support :
Sensor Device
SEL Device
FRU Inventory Device
Chassis Device
Aux Firmware Rev Info :
0x00
0x00
0x00
0x00
```

Change-Id: I372c9433a274bc633a24d213b7a1bc205531e33d
Signed-off-by: Willy Tu <wltu@google.com>

show more ...


# c5324251 31-Oct-2019 Tony Lee <tony.lee@quantatw.com>

Fix issues and support signed sensor values

Sensor will get "disable" when the command "ipmitool sdr elist" is
executed that if sensorReadingType is 0x6F.

sensor_units_1 is always set to 0 currentl

Fix issues and support signed sensor values

Sensor will get "disable" when the command "ipmitool sdr elist" is
executed that if sensorReadingType is 0x6F.

sensor_units_1 is always set to 0 currently. To support the display of
signed sensor values, we add the attribute "sensorUnits1" to the sensor
mapping yaml. This attribute can be used to determine whether the
sensor is signed.

It were making negative values 0 in get::readingData(). Fix the issue
by using a int32_t and add an overflow check.

Change-Id: I705defcf18805db9ada7d0de0738a59aedab61df
Signed-off-by: Tony Lee <tony.lee@quantatw.com>

show more ...


# be4ffa87 10-Aug-2020 Jeremy Kerr <jk@codeconstruct.com.au>

sensor yaml: allow custom sensor names

Currently, we can only name sensors based on data from the dbus object
implementing a sensor's interface. While this mostly works, there may
not be a sensible

sensor yaml: allow custom sensor names

Currently, we can only name sensors based on data from the dbus object
implementing a sensor's interface. While this mostly works, there may
not be a sensible name to extract in all cases.

This change introduces an optional sensorName property to the sensor
YAML description, which allows a custom name to be used.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Change-Id: I3f3b8ef581c70fbde94db122d4f3c0ca181c6ff7

show more ...


# 8deea358 10-Aug-2020 Jeremy Kerr <jk@codeconstruct.com.au>

scripts/writesensor: make sensor map definition less cryptic

Use .name = value initialisers when generating the IdInfoMap, so it's
more obvious which members are being initialised.

Signed-off-by: J

scripts/writesensor: make sensor map definition less cryptic

Use .name = value initialisers when generating the IdInfoMap, so it's
more obvious which members are being initialised.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Change-Id: If6d33883e02790f59e26fb72a1b783e8256aaca9

show more ...


# 31eed5c5 23-Mar-2020 Tom Joseph <tomjoseph@in.ibm.com>

Switch to python3

Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
Change-Id: I86ca25173c745442760eddd608ad48985cd46ee0


# db0cbe64 09-Sep-2019 Patrick Venture <venture@google.com>

move sensors into ipmi::sensor namespace

The object was left in the global namespace, but the type was in the
ipmi::sensor namespace. Move the object into the namespace.

Signed-off-by: Patrick Ven

move sensors into ipmi::sensor namespace

The object was left in the global namespace, but the type was in the
ipmi::sensor namespace. Move the object into the namespace.

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I88e46da4abda220d3b6fcc2ea64b8ef0decb0dc3

show more ...


# bbf8bd6c 01-May-2019 Santosh Puranik <santosh.puranik@in.ibm.com>

sensordatahandler: Support empty inventory interfaces

This commit adds support for empty inventory interfaces when
asserting a sensor into the inventory. This is something already
supported in ipmi-

sensordatahandler: Support empty inventory interfaces

This commit adds support for empty inventory interfaces when
asserting a sensor into the inventory. This is something already
supported in ipmi-fru-parser, for example.

Currently, the notify::assertion function expects that each DBUS
interface also have a set of associated properties. One of the
use-cases this commit tries to solve is when a sensor being asserted
maps to an inventory item (accessed via
xyz.openbmc_project.Inventory.Manager DBUS service) that implements
a DBUS interface with no properties. For example, the GPU sensor
is mapped to a GPU inventory object that implements the DBUS
interface xyz.openbmc_project.Inventory.Item.Accelerator.
This commit enables phosphor-host-ipmid to correctly create/update
inventory objects even in cases where they implement DBUS interfaces
that contain no properties.

The sensor-example.yaml file has been updated to show an example
of a GPU sensor, the inventory object for which implements a
property-less DBUS interface.

Tested:

Tested on a witherspoon system that had some GPUs attached to it.
Pulled also https://gerrit.openbmc-project.xyz/c/openbmc/openbmc/+/21107
in order to generate the right sensor configs for testing.
Verified that the GPU invetory objects that are created when the host
asserts a GPU sensor now implement the empty interface
xyz.openbmc_project.Inventory.Item.Accelerator

Signed-off-by: Santosh Puranik <santosh.puranik@in.ibm.com>
Change-Id: I973580e285ae0fff1a513d3bbe8c03a89e0eeb83

show more ...


# 33250240 12-Mar-2019 Vernon Mauery <vernon.mauery@linux.intel.com>

move types.hpp to ipmid/types.hpp for export

types.hpp is required by utility.hpp, which is exported, so it needs to
be exported as well. This moves it to the include/libipmid directory,
changes the

move types.hpp to ipmid/types.hpp for export

types.hpp is required by utility.hpp, which is exported, so it needs to
be exported as well. This moves it to the include/libipmid directory,
changes the Makefile to export it, and changes all the files that
include it so it can be found in the right place.

Change-Id: I30ec365446e4de466c266ec4faa327478460ec05
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>

show more ...


# 4d1a5dd4 10-Oct-2018 Kirill Pakhomov <k.pakhomov@yadro.com>

Fix the exponent B in writesensors mako template

expB has been mistyped as exp() function,
resulting in a build error upon providing
bExp as signed integer in config.yaml

Change-Id: Ibc7ed45e445c4f

Fix the exponent B in writesensors mako template

expB has been mistyped as exp() function,
resulting in a build error upon providing
bExp as signed integer in config.yaml

Change-Id: Ibc7ed45e445c4f37b7a6ccdf10346177a3317b0b
Signed-off-by: Kirill Pakhomov <k.pakhomov@yadro.com>

show more ...


# 0a1301c1 15-Feb-2018 Tom Joseph <tomjoseph@in.ibm.com>

sensor: Add result exponent to the sensor yaml

Result exponent sets the decimal point location for the result before
the linearization function is applied. This is different from the scale
implement

sensor: Add result exponent to the sensor yaml

Result exponent sets the decimal point location for the result before
the linearization function is applied. This is different from the scale
implemented by the sensors dbus objects. The scale is the scaling factor
to get the value for the units specified for the sensor. Linearization
is done after applying the scale on the raw sensor value.

Change-Id: I76624c593bf6cdf40ec884c0ff0aceb58746732c
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>

show more ...


# 31ff6e6f 24-Jan-2018 Tom Joseph <tomjoseph@in.ibm.com>

sensor: Populate entity id, instance and sensor name callback

Change-Id: Ie7bf403ae15d9b1a70216aab0c57362c3d4240e7
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>


# 62235618 14-Jun-2017 Emily Shaffer <emilyshaffer@google.com>

sensorhandler: allow preconfigured unit and scale

Allow specifying the scale and unit for a sensor in the
YAML configuration. This can save clock time by no longer
requiring the daemon to reach out

sensorhandler: allow preconfigured unit and scale

Allow specifying the scale and unit for a sensor in the
YAML configuration. This can save clock time by no longer
requiring the daemon to reach out to the sensor owner for
the information.

Change-Id: I5f63286fc32fb9d64ebab7d86d1dbb7ff40591f4
Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Patrick Venture <venture@google.com>

show more ...


# e245e4e9 03-Oct-2017 Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>

IPMI changes to mark non present as non functional

When marking a unit as functional, both functional state
and presence need to be checked to avoid marking non-present
units as functional.

Change-

IPMI changes to mark non present as non functional

When marking a unit as functional, both functional state
and presence need to be checked to avoid marking non-present
units as functional.

Change-Id: If7b710c39f1c2590b82378ebdb7014dc924599ff
Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>

show more ...


# e84841ce 22-Aug-2017 Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>

IPMI changes to skip updating non present cores

Cores which are not present need not to be updated
to inventory. This change is for skipping several
updates to inventory based on skipOn value.

Chan

IPMI changes to skip updating non present cores

Cores which are not present need not to be updated
to inventory. This change is for skipping several
updates to inventory based on skipOn value.

Change-Id: I29e005a715ccae1df6eeaf35561a20896ecde0ac
Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>

show more ...


# 580af36b 07-Sep-2017 Tom Joseph <tomjoseph@in.ibm.com>

sensor: Pass the dbus property type as a template parameter

readingAssertion and reading type of sensors, take the dbus
property type as template parameters. Instead of generating
code to handle tha

sensor: Pass the dbus property type as a template parameter

readingAssertion and reading type of sensors, take the dbus
property type as template parameters. Instead of generating
code to handle that, the function parameter is updated with
the template parameter.

Resolves openbmc/openbmc#2220

Change-Id: Ib9e15727ba96e3a53c46f17bffc9ef68dbf73194
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>

show more ...


# b673ff6a 07-Sep-2017 Tom Joseph <tomjoseph@in.ibm.com>

sensor: Correct the offset field in reading calculation

Change-Id: If85dd3d6705ccc86a8e3406ef5f90fcc6e2967d1
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>


# 9f9a9a4d 06-Sep-2017 Tom Joseph <tomjoseph@in.ibm.com>

sensor: Modify mako template to generate sensor getter func

Change-Id: If198d9a9fb1145bbaeda528e3f80356527b80059
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>


# cc941e15 14-Jun-2017 Emily Shaffer <emilyshaffer@google.com>

sensorhandler: support setting analog sensors

Refactor YAML format to denote mutability of sensors.

Sensors which expect different formats for reads and writes
should present two entries in the sen

sensorhandler: support setting analog sensors

Refactor YAML format to denote mutability of sensors.

Sensors which expect different formats for reads and writes
should present two entries in the sensor YAML, one with the read
interface and one with the write interface. Sensors which
share a format for both reads and writes may present only one entry
in the YAML with both readable and writable enums specified.

If a sensor receives a write which has an interface of Sensor.Value,
the "Set" message is sent via DBus to the path provided in the YAML.
The previous codepath is maintained.

Change-Id: I292f95b6fe936de759fd65ce72c842a1bfe66448
Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Patrick Venture <venture@google.com>

show more ...


# 1bb0d387 12-Aug-2017 Deepak Kodihalli <dkodihal@in.ibm.com>

Refactor set sensor handling code

A summary of the changes:

- Do not generate per sensor type code to update d-bus objects
corresponding to sensors. Function to update d-bus objects based on
st

Refactor set sensor handling code

A summary of the changes:

- Do not generate per sensor type code to update d-bus objects
corresponding to sensors. Function to update d-bus objects based on
standard sensor event types, such as assertion, event data, are now
generic functions - the need not be generated per sensor or per sensor
type.
- There's a special case where the assertion is treated as a reading
(i.e read the entire assertion field as-is). In this case, code needs
to be generated per sensor because the type of the mapped d-bus
property can vary. In this case have a generic template function, and
generate minimal code like so:
inline ipmi_ret_t readingAssertion(const SetSensorReadingReq& cmdData,
const Info& sensorInfo)
{
// Corresponding d-bus property is uint32_t
return set::readingAssertion<uint32_t>(cmdData, sensorInfo);
}
- Make sensor-example.yaml succinct.
- Make the code in writesensor.mako.cpp more pythonic.

Change-Id: I84415ca6e3f756bbb51a90e290539eb086a7f78b
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>

show more ...


# 18e99992 09-Aug-2017 Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>

Fix for reboot attempt and catch internal failures.

The assumption was reboot attempt left will be sent through
reading data in ipmi sensor data, but it is being sent as
assertion so adding support

Fix for reboot attempt and catch internal failures.

The assumption was reboot attempt left will be sent through
reading data in ipmi sensor data, but it is being sent as
assertion so adding support to read raw data from assertion bits.
Added a catch for internal failures while calling update function
for sensors.

Change-Id: If45d003c1c22f60e7c8a723c1ff9d077c53cad37
Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>

show more ...


# e0af7209 12-Jul-2017 Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>

IPMI: Virtual sensor support in host ipmid

Resolves openbmc/openbmc#1608

Change-Id: Id76446061fd0fa6dc3dead702538e424293af7ce
Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>


# 10f4959a 10-May-2017 Emily Shaffer <emilyshaffer@google.com>

sensorhandler: Add functionality to use m, b, b_exp from config.yaml

Change-Id: I1b5b8a5e0e5abd74eadde494728f363cf1ca4ec6
Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Patric

sensorhandler: Add functionality to use m, b, b_exp from config.yaml

Change-Id: I1b5b8a5e0e5abd74eadde494728f363cf1ca4ec6
Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# ca4c4467 15-Mar-2017 Ratan Gupta <ratagupt@in.ibm.com>

inventory: undo the capitilization of yaml decoder

yaml decoder capitalize the boolean values which is
not liked by c++ compiler so undoing the capitalization.

Change-Id: I1de142de76e21b2759db759c5

inventory: undo the capitilization of yaml decoder

yaml decoder capitalize the boolean values which is
not liked by c++ compiler so undoing the capitalization.

Change-Id: I1de142de76e21b2759db759c5a182c42400e34d1
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>

show more ...


# 0065905e 23-Feb-2017 Ratan Gupta <ratagupt@in.ibm.com>

inventory: write sensor yaml parser

Write python-based parser for sensor.yaml. The parser generates
sensor-gen.cpp,which is having a map of sensorid(key) and
sensorinfo(value).

Change-Id: I5aa2d2bc

inventory: write sensor yaml parser

Write python-based parser for sensor.yaml. The parser generates
sensor-gen.cpp,which is having a map of sensorid(key) and
sensorinfo(value).

Change-Id: I5aa2d2bc871ced06e5e4c164a67eeb5974031d5d
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>

show more ...