peci_cmds: Add request-to-response latency measurement

To help in validation of the peci interface, this patch adds capability
in peci_cmds utility to measure request to response delays. A new
swith -t option provides this capability and it is designed to work
with other switches like verbose mode and command loop mode.

The desired behaviour of the -t switch is as follows:
1) -t switch used in isolation will measure the latency of only the
single command under execution.
2) -t switch with -l (loop) mode will measure the total latency and
provides average per command execution time.
3) -t switch with -l (loop) and -v (verbose) mode will capture total
latency, overall average as well as per command execution times.

Tested:
Case 1)
root# peci_cmds ping -t
Succeeded
Total time taken = 0.000212 seconds

Case 2)
root# peci_cmds ping -t -l 10
Succeeded
Total time taken = 0.001365 seconds
Average time taken per command = 0.000137 seconds

Case 3)
root# peci_cmds ping -t -l 6 -v
Time taken in iteration 1 = 0.000121 s
Succeeded

Time taken in iteration 2 = 0.000122 s
Succeeded

Time taken in iteration 3 = 0.000141 s
Succeeded

Time taken in iteration 4 = 0.000138 s
Succeeded

Time taken in iteration 5 = 0.000143 s
Succeeded

Time taken in iteration 6 = 0.000112 s
Succeeded
Total time taken = 0.000777 seconds
Average time taken per command = 0.000129 seconds

Change-Id: Idde67a6aed05367d91a7bdc807ae1fbfe2a81104
Signed-off-by: Sumanth Bhat <sumanth.bhat@linux.intel.com>
1 file changed
tree: 4e70edb217f66bed716db8b18a2928b804a7bca2
  1. linux/
  2. service_files/
  3. .clang-format
  4. .clang-format-ignore
  5. CMakeLists.txt
  6. dbus_raw_peci.cpp
  7. LICENSE
  8. OWNERS
  9. peci.c
  10. peci.h
  11. peci.pc.in
  12. peci_cmds.c
  13. README.md
README.md

libpeci

libpeci is a library that provides various APIs to interface with the IOCTLs provided by the PECI driver in the OpenBMC kernel. Currently available here:

https://github.com/openbmc/linux/blob/dev-5.4/include/uapi/linux/peci-ioctl.h

peci_cmds

This repo also includes a peci_cmds command-line utility with functions that map to the libpeci APIs. It can be used to test PECI functionality across the library, driver, and hardware.

dbus_raw_peci

This repo also includes dbus_raw_peci which provides a raw-peci daemon that exposes a raw PECI interface that is accessible over D-Bus. It can be used when an application needs to send a raw PECI command without loading the full PECI library.