LCOV - code coverage report
Current view: top level - drivers/common/cnxk - cnxk_telemetry_sso.c (source / functions) Hit Total Coverage
Test: Code coverage Lines: 3 19 15.8 %
Date: 2025-03-01 20:23:48 Functions: 1 3 33.3 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 2 0.0 %

           Branch data     Line data    Source code
       1                 :            : 
       2                 :            : /* SPDX-License-Identifier: BSD-3-Clause
       3                 :            :  * Copyright(C) 2021 Marvell.
       4                 :            :  */
       5                 :            : 
       6                 :            : #include <unistd.h>
       7                 :            : 
       8                 :            : #include "cnxk_telemetry.h"
       9                 :            : #include "roc_api.h"
      10                 :            : #include "roc_priv.h"
      11                 :            : 
      12                 :            : static int
      13                 :          0 : cnxk_tel_sso(struct plt_tel_data *d)
      14                 :            : {
      15                 :            :         struct roc_sso *roc_sso;
      16                 :            :         struct sso *sso;
      17                 :            : 
      18                 :          0 :         roc_sso = idev_sso_get();
      19         [ #  # ]:          0 :         if (roc_sso == NULL)
      20                 :            :                 return SSO_ERR_DEVICE_NOT_BOUNDED;
      21                 :            : 
      22                 :            :         sso = roc_sso_to_sso_priv(roc_sso);
      23                 :          0 :         plt_tel_data_add_dict_ptr(d, "roc_sso", roc_sso);
      24                 :          0 :         plt_tel_data_add_dict_ptr(d, "sso", sso);
      25                 :          0 :         plt_tel_data_add_dict_int(d, "max_hws", roc_sso->max_hws);
      26                 :          0 :         plt_tel_data_add_dict_int(d, "max_hwgrp", roc_sso->max_hwgrp);
      27                 :          0 :         plt_tel_data_add_dict_int(d, "nb_hws", roc_sso->nb_hws);
      28                 :          0 :         plt_tel_data_add_dict_int(d, "nb_hwgrp", roc_sso->nb_hwgrp);
      29                 :          0 :         plt_tel_data_add_dict_int(d, "pf_func", sso->dev.pf_func);
      30                 :          0 :         plt_tel_data_add_dict_int(d, "pid", getpid());
      31                 :            : 
      32                 :          0 :         return 0;
      33                 :            : }
      34                 :            : 
      35                 :            : static int
      36                 :          0 : cnxk_sso_tel_handle_info(const char *cmd __plt_unused,
      37                 :            :                          const char *params __plt_unused,
      38                 :            :                          struct plt_tel_data *d)
      39                 :            : {
      40                 :          0 :         plt_tel_data_start_dict(d);
      41                 :          0 :         cnxk_tel_sso(d);
      42                 :          0 :         return 0;
      43                 :            : }
      44                 :            : 
      45                 :        252 : PLT_INIT(cnxk_telemetry_sso_init)
      46                 :            : {
      47                 :        252 :         plt_telemetry_register_cmd(
      48                 :            :                 "/cnxk/sso/info", cnxk_sso_tel_handle_info,
      49                 :            :                 "Returns sso information. Takes no parameters");
      50                 :        252 : }

Generated by: LCOV version 1.14