tools: Add lshal tool to get hal backends 00/291600/2
authorChanwoo Choi <cw00.choi@samsung.com>
Mon, 13 Mar 2023 21:17:42 +0000 (06:17 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 20 Apr 2023 04:44:57 +0000 (13:44 +0900)
commite1a40bc9515af39043f3b1cafd385f1c7fc0915b
tree44278610fe3c450048ba88a54d8c17425403acda
parent5d2ce093a0c4d6c97a4dabf9ab67d5eff5450d9c
tools: Add lshal tool to get hal backends

Provide lshal to get the detailed informaiton of hal backends on device.

[Description of each attribute of lshal tool]
- HAL Module Name          : HAL Module Name (fixed, not be changed)
- ID                       : HAL Module Unique ID (fixed, not be changed)
- Backend Library Name     : HAL Backend Library Name (fixed, not be changed)
- Backend Open Count       : HAL Backend Open Count (it's changed according to user count)
- Backend Verification     : If there is HAL backend, print "YES".
                           : If HAL backend is verified (get/put_backen), print "VERIFIED".
- Backend Symbol Name      : HAL Backend Symbol Name (fixed, not be changed)
- Backend ABI Version      : HAL Backend ABI Version (Written by Backend Developer)
- Backend Name             : HAL Backend Name (Written by Backend Developer)
- Vendor Name              : HAL Backend Vendor Name (Written by Backend Developer)
- TOTAL                    : The number of HAL modules and backends

[Example on rpi4 armv7l environment]
root:~> lshal
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                        |    |                                                         | Backend    | Backend         | Backend                                       | Backend ABI Version       | Backend Name              | Vendor Name               |
 HAL Module Name                        | ID | Backend Library Name                                    | Open Count | Verification    | Symbol Name                                   | (Written by Developer)    | (Written by Developer)    | (Written by Developer)    |
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 HAL_MODULE_TBM                         | 1  | /hal/lib/libhal-backend-tbm.so                          | 4          | YES | VERIFIED  | hal_backend_tbm_data                          | HAL_ABI_VERSION_TIZEN_6_5 | vc4                       | Samsung                   |
 HAL_MODULE_TDM                         | 2  | /hal/lib/libhal-backend-tdm.so                          | 2          | YES | VERIFIED  | hal_backend_tdm_data                          | HAL_ABI_VERSION_TIZEN_6_5 | vc4                       | Samsung                   |
 HAL_MODULE_COREGL                      | 3  |                                                         |            |     |           |                                               |                           |                           |                           |
 HAL_MODULE_INPUT                       | 4  |                                                         |            |     |           |                                               |                           |                           |                           |
 HAL_MODULE_AUDIO                       | 5  | /hal/lib/libhal-backend-audio.so                        | 1          | YES | VERIFIED  | hal_backend_audio_data                        | HAL_ABI_VERSION_TIZEN_6_5 | audio-rpi                 | Broadcom                  |
 HAL_MODULE_CAMERA                      | 6  | /hal/lib/libhal-backend-camera.so                       | 1          | YES | VERIFIED  | hal_backend_camera_data                       | HAL_ABI_VERSION_TIZEN_6_5 | camera-v4l2               | TIZEN                     |
 HAL_MODULE_RADIO                       | 7  | /hal/lib/libhal-backend-radio.so                        | 0          | NO  |           | hal_backend_radio_data                        |                           |                           |                           |
 HAL_MODULE_CODEC                       | 8  |                                                         |            |     |           |                                               |                           |                           |                           |
 HAL_MODULE_USB_AUDIO                   | 9  |                                                         |            |     |           |                                               |                           |                           |                           |
 HAL_MODULE_ALSAUCM                     | 10 |                                                         |            |     |           |                                               |                           |                           |                           |
 HAL_MODULE_BLUETOOTH                   | 11 | /hal/lib/libhal-backend-bluetooth.so                    | 1          | YES | VERIFIED  | hal_backend_bluetooth_data                    | HAL_ABI_VERSION_TIZEN_6_5 | bluetooth                 | broadcom                  |
 HAL_MODULE_WIFI                        | 12 | /hal/lib/libhal-backend-wifi.so                         | 0          | NO  |           | hal_backend_wifi_data                         |                           |                           |                           |
 HAL_MODULE_NAN                         | 13 |                                                         |            |     |           |                                               |                           |                           |                           |
 HAL_MODULE_NFC                         | 14 | /hal/lib/libhal-backend-nfc.so                          | 0          | NO  |           | hal_backend_nfc_data                          |                           |                           |                           |
 HAL_MODULE_ZIGBEE                      | 15 | /hal/lib/libhal-backend-zigbee.so                       | 0          | NO  |           | hal_backend_zigbee_data                       |                           |                           |                           |
 HAL_MODULE_UWB                         | 16 | /hal/lib/libhal-backend-uwb.so                          | 0          | NO  |           | hal_backend_uwb_data                          |                           |                           |                           |
 HAL_MODULE_MTP                         | 17 |                                                         |            |     |           |                                               |                           |                           |                           |
 HAL_MODULE_TELEPHONY                   | 18 |                                                         |            |     |           |                                               |                           |                           |                           |
 HAL_MODULE_LOCATION                    | 19 | /hal/lib/libhal-backend-location.so                     | 3          | YES | VERIFIED  | hal_backend_location_data                     | HAL_ABI_VERSION_TIZEN_6_5 | location-backend          | replay                    |
 HAL_MODULE_COMMON                      | 20 |                                                         |            |     |           |                                               |                           |                           |                           |
 HAL_MODULE_POWER                       | 21 | /hal/lib/libhal-backend-power.so                        | 1          | YES | VERIFIED  | hal_backend_power_data                        | HAL_ABI_VERSION_TIZEN_6_5 | power-rpi4                | Rasberry Pi               |
 HAL_MODULE_SENSOR                      | 22 | /hal/lib/libhal-backend-sensor.so                       | 0          | NO  |           | hal_backend_sensor_data                       |                           |                           |                           |
 HAL_MODULE_PERIPHERAL                  | 23 |                                                         |            |     |           |                                               |                           |                           |                           |
 HAL_MODULE_DEVICE_BATTERY              | 24 | /hal/lib/libhal-backend-device-battery.so               | 0          | NO  |           | hal_backend_device_battery_data               |                           |                           |                           |
 HAL_MODULE_DEVICE_BEZEL                | 25 | /hal/lib/libhal-backend-device-bezel.so                 | 0          | NO  |           | hal_backend_device_bezel_data                 |                           |                           |                           |
 HAL_MODULE_DEVICE_DISPLAY              | 26 | /hal/lib/libhal-backend-device-display.so               | 2          | YES | VERIFIED  | hal_backend_device_display_data               | HAL_ABI_VERSION_TIZEN_7_0 | display                   | RPI                       |
 HAL_MODULE_DEVICE_IR                   | 27 | /hal/lib/libhal-backend-device-ir.so                    | 0          | NO  |           | hal_backend_device_ir_data                    |                           |                           |                           |
 HAL_MODULE_DEVICE_TOUCHSCREEN          | 28 | /hal/lib/libhal-backend-device-touchscreen.so           | 1          | YES | VERIFIED  | hal_backend_device_touchscreen_data           | HAL_ABI_VERSION_TIZEN_7_0 | touchscreen               | RPI                       |
 HAL_MODULE_DEVICE_LED                  | 29 | /hal/lib/libhal-backend-device-led.so                   | 1          | YES | VERIFIED  | hal_backend_device_led_data                   | HAL_ABI_VERSION_TIZEN_7_0 | led                       | RPI                       |
 HAL_MODULE_DEVICE_BOARD                | 30 | /hal/lib/libhal-backend-device-board.so                 | 1          | YES | VERIFIED  | hal_backend_device_board_data                 | HAL_ABI_VERSION_TIZEN_7_0 | board                     | RPI                       |
 HAL_MODULE_DEVICE_EXTERNAL_CONNECTION  | 31 | /hal/lib/libhal-backend-device-external-connection.so   | 0          | NO  |           | hal_backend_device_external_connection_data   |                           |                           |                           |
 HAL_MODULE_DEVICE_THERMAL              | 32 | /hal/lib/libhal-backend-device-thermal.so               | 1          | YES | VERIFIED  | hal_backend_device_thermal_data               | HAL_ABI_VERSION_TIZEN_7_0 | thermal                   | RPI                       |
 HAL_MODULE_DEVICE_USB_GADGET           | 33 | /hal/lib/libhal-backend-device-usb-gadget.so            | 0          | NO  |           | hal_backend_device_usb_gadget_data            |                           |                           |                           |
 HAL_MODULE_DEVICE_HAPTIC               | 34 | /hal/lib/libhal-backend-device-haptic.so                | 1          | YES | VERIFIED  | hal_backend_device_haptic_data                | HAL_ABI_VERSION_TIZEN_7_0 | haptic                    | RPI                       |
 HAL_MODULE_DEVICE_MEMORY               | 35 | /hal/lib/libhal-backend-device-memory.so                | 1          | YES | VERIFIED  | hal_backend_device_memory_data                | HAL_ABI_VERSION_TIZEN_7_0 | memory                    | RPI                       |
 HAL_MODULE_DEVICE_INPUT                | 36 | /hal/lib/libhal-backend-device-input.so                 | 0          | NO  |           | hal_backend_device_input_data                 |                           |                           |                           |
 HAL_MODULE_DEVICE_POWER                | 37 | /hal/lib/libhal-backend-device-power.so                 | 0          | NO  |           | hal_backend_device_power_data                 |                           |                           |                           |
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 TOTAL                                  | 37 |                                                         |            |              14 |                                               |                           |                           |                           |
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Change-Id: Id8246ff25d6cabf785b3fd1c6f24b1a1749daf0f
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
CMakeLists.txt
packaging/hal-api-common.spec
tools/lshal/CMakeLists.txt [new file with mode: 0644]
tools/lshal/lshal.c [new file with mode: 0644]