[v4] app/procinfo: add device private info dump

Message ID 20220606143932.12772-1-liudongdong3@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v4] app/procinfo: add device private info dump |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing fail Testing issues
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Dongdong Liu June 6, 2022, 2:39 p.m. UTC
  From: "Min Hu (Connor)" <humin29@huawei.com>

This patch adds support for dump the device private info from a running
application. It can help developers locate the problem.

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
---
v3->v4:
- add Acked-by Reshma.

v2->v3:
- fix wrong spelling.

v1->v2:
- fix way of handling ports.
---
 app/proc-info/main.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
  

Comments

Dongdong Liu June 13, 2022, 12:45 p.m. UTC | #1
Hi Maryam, ferruh

kind ping...

If there are no other comments, could you help to
apply this patch.

Thanks,
Dongdong
On 2022/6/6 22:39, Dongdong Liu wrote:
> From: "Min Hu (Connor)" <humin29@huawei.com>
>
> This patch adds support for dump the device private info from a running
> application. It can help developers locate the problem.
>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
> Acked-by: Reshma Pattan <reshma.pattan@intel.com>
> ---
> v3->v4:
> - add Acked-by Reshma.
>
> v2->v3:
> - fix wrong spelling.
>
> v1->v2:
> - fix way of handling ports.
> ---
>  app/proc-info/main.c | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
>
> diff --git a/app/proc-info/main.c b/app/proc-info/main.c
> index 56070a3317..1d350291b9 100644
> --- a/app/proc-info/main.c
> +++ b/app/proc-info/main.c
> @@ -84,6 +84,8 @@ static char bdr_str[MAX_STRING_LEN];
>
>  /**< Enable show port. */
>  static uint32_t enable_shw_port;
> +/**< Enable show port private info. */
> +static uint32_t enable_shw_port_priv;
>  /**< Enable show tm. */
>  static uint32_t enable_shw_tm;
>  /**< Enable show crypto. */
> @@ -123,6 +125,7 @@ proc_info_usage(const char *prgname)
>  		"  --collectd-format: to print statistics to STDOUT in expected by collectd format\n"
>  		"  --host-id STRING: host id used to identify the system process is running on\n"
>  		"  --show-port: to display ports information\n"
> +		"  --show-port-private: to display ports private information\n"
>  		"  --show-tm: to display traffic manager information for ports\n"
>  		"  --show-crypto: to display crypto information\n"
>  		"  --show-ring[=name]: to display ring information\n"
> @@ -232,6 +235,7 @@ proc_info_parse_args(int argc, char **argv)
>  		{"xstats-ids", 1, NULL, 1},
>  		{"host-id", 0, NULL, 0},
>  		{"show-port", 0, NULL, 0},
> +		{"show-port-private", 0, NULL, 0},
>  		{"show-tm", 0, NULL, 0},
>  		{"show-crypto", 0, NULL, 0},
>  		{"show-ring", optional_argument, NULL, 0},
> @@ -284,6 +288,9 @@ proc_info_parse_args(int argc, char **argv)
>  			else if (!strncmp(long_option[option_index].name,
>  					"show-port", MAX_LONG_OPT_SZ))
>  				enable_shw_port = 1;
> +			else if (!strncmp(long_option[option_index].name,
> +					"show-port-private", MAX_LONG_OPT_SZ))
> +				enable_shw_port_priv = 1;
>  			else if (!strncmp(long_option[option_index].name,
>  					"show-tm", MAX_LONG_OPT_SZ))
>  				enable_shw_tm = 1;
> @@ -887,6 +894,25 @@ show_port(void)
>  	}
>  }
>
> +static void
> +show_port_private_info(void)
> +{
> +	int i;
> +
> +	snprintf(bdr_str, MAX_STRING_LEN, " Dump - Ports private information");
> +	STATS_BDR_STR(10, bdr_str);
> +
> +	RTE_ETH_FOREACH_DEV(i) {
> +		/* Skip if port is not in mask */
> +		if ((enabled_port_mask & (1ul << i)) == 0)
> +			continue;
> +
> +		snprintf(bdr_str, MAX_STRING_LEN, " Port %u ", i);
> +		STATS_BDR_STR(5, bdr_str);
> +		rte_eth_dev_priv_dump(i, stdout);
> +	}
> +}
> +
>  static void
>  display_nodecap_info(int is_leaf, struct rte_tm_node_capabilities *cap)
>  {
> @@ -1549,6 +1575,8 @@ main(int argc, char **argv)
>  	/* show information for PMD */
>  	if (enable_shw_port)
>  		show_port();
> +	if (enable_shw_port_priv)
> +		show_port_private_info();
>  	if (enable_shw_tm)
>  		show_tm();
>  	if (enable_shw_crypto)
>
  
Dongdong Liu June 13, 2022, 12:51 p.m. UTC | #2
+cc Ferruh (ferruh.yigit@xilinx.com).

It seems this email could not be delivered to maryam.tahhan@intel.com.

Thanks,
Dongdong
On 2022/6/13 20:45, Dongdong Liu wrote:
> Hi Maryam, ferruh
>
> kind ping...
>
> If there are no other comments, could you help to
> apply this patch.
>
> Thanks,
> Dongdong
> On 2022/6/6 22:39, Dongdong Liu wrote:
>> From: "Min Hu (Connor)" <humin29@huawei.com>
>>
>> This patch adds support for dump the device private info from a running
>> application. It can help developers locate the problem.
>>
>> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
>> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
>> Acked-by: Reshma Pattan <reshma.pattan@intel.com>
>> ---
>> v3->v4:
>> - add Acked-by Reshma.
>>
>> v2->v3:
>> - fix wrong spelling.
>>
>> v1->v2:
>> - fix way of handling ports.
>> ---
>>  app/proc-info/main.c | 28 ++++++++++++++++++++++++++++
>>  1 file changed, 28 insertions(+)
>>
>> diff --git a/app/proc-info/main.c b/app/proc-info/main.c
>> index 56070a3317..1d350291b9 100644
>> --- a/app/proc-info/main.c
>> +++ b/app/proc-info/main.c
>> @@ -84,6 +84,8 @@ static char bdr_str[MAX_STRING_LEN];
>>
>>  /**< Enable show port. */
>>  static uint32_t enable_shw_port;
>> +/**< Enable show port private info. */
>> +static uint32_t enable_shw_port_priv;
>>  /**< Enable show tm. */
>>  static uint32_t enable_shw_tm;
>>  /**< Enable show crypto. */
>> @@ -123,6 +125,7 @@ proc_info_usage(const char *prgname)
>>          "  --collectd-format: to print statistics to STDOUT in
>> expected by collectd format\n"
>>          "  --host-id STRING: host id used to identify the system
>> process is running on\n"
>>          "  --show-port: to display ports information\n"
>> +        "  --show-port-private: to display ports private information\n"
>>          "  --show-tm: to display traffic manager information for
>> ports\n"
>>          "  --show-crypto: to display crypto information\n"
>>          "  --show-ring[=name]: to display ring information\n"
>> @@ -232,6 +235,7 @@ proc_info_parse_args(int argc, char **argv)
>>          {"xstats-ids", 1, NULL, 1},
>>          {"host-id", 0, NULL, 0},
>>          {"show-port", 0, NULL, 0},
>> +        {"show-port-private", 0, NULL, 0},
>>          {"show-tm", 0, NULL, 0},
>>          {"show-crypto", 0, NULL, 0},
>>          {"show-ring", optional_argument, NULL, 0},
>> @@ -284,6 +288,9 @@ proc_info_parse_args(int argc, char **argv)
>>              else if (!strncmp(long_option[option_index].name,
>>                      "show-port", MAX_LONG_OPT_SZ))
>>                  enable_shw_port = 1;
>> +            else if (!strncmp(long_option[option_index].name,
>> +                    "show-port-private", MAX_LONG_OPT_SZ))
>> +                enable_shw_port_priv = 1;
>>              else if (!strncmp(long_option[option_index].name,
>>                      "show-tm", MAX_LONG_OPT_SZ))
>>                  enable_shw_tm = 1;
>> @@ -887,6 +894,25 @@ show_port(void)
>>      }
>>  }
>>
>> +static void
>> +show_port_private_info(void)
>> +{
>> +    int i;
>> +
>> +    snprintf(bdr_str, MAX_STRING_LEN, " Dump - Ports private
>> information");
>> +    STATS_BDR_STR(10, bdr_str);
>> +
>> +    RTE_ETH_FOREACH_DEV(i) {
>> +        /* Skip if port is not in mask */
>> +        if ((enabled_port_mask & (1ul << i)) == 0)
>> +            continue;
>> +
>> +        snprintf(bdr_str, MAX_STRING_LEN, " Port %u ", i);
>> +        STATS_BDR_STR(5, bdr_str);
>> +        rte_eth_dev_priv_dump(i, stdout);
>> +    }
>> +}
>> +
>>  static void
>>  display_nodecap_info(int is_leaf, struct rte_tm_node_capabilities *cap)
>>  {
>> @@ -1549,6 +1575,8 @@ main(int argc, char **argv)
>>      /* show information for PMD */
>>      if (enable_shw_port)
>>          show_port();
>> +    if (enable_shw_port_priv)
>> +        show_port_private_info();
>>      if (enable_shw_tm)
>>          show_tm();
>>      if (enable_shw_crypto)
>>
> .
>
  
Thomas Monjalon June 26, 2022, 3:50 p.m. UTC | #3
06/06/2022 16:39, Dongdong Liu:
> From: "Min Hu (Connor)" <humin29@huawei.com>
> 
> This patch adds support for dump the device private info from a running
> application. It can help developers locate the problem.
> 
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
> Acked-by: Reshma Pattan <reshma.pattan@intel.com>

Applied, thanks.

[...]
>  /**< Enable show port. */
>  static uint32_t enable_shw_port;
> +/**< Enable show port private info. */
> +static uint32_t enable_shw_port_priv;

That's very strange this file is using some (wrong) doxygen syntax.
I'll fix this one when applying.
A cleanup may be needed for other comments in the file.

>  /**< Enable show tm. */
>  static uint32_t enable_shw_tm;
>  /**< Enable show crypto. */
  
Dongdong Liu July 2, 2022, 8:22 a.m. UTC | #4
Hi Thomas

On 2022/6/26 23:50, Thomas Monjalon wrote:
> 06/06/2022 16:39, Dongdong Liu:
>> From: "Min Hu (Connor)" <humin29@huawei.com>
>>
>> This patch adds support for dump the device private info from a running
>> application. It can help developers locate the problem.
>>
>> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
>> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
>> Acked-by: Reshma Pattan <reshma.pattan@intel.com>
>
> Applied, thanks.
>
> [...]
>>  /**< Enable show port. */
>>  static uint32_t enable_shw_port;
>> +/**< Enable show port private info. */
>> +static uint32_t enable_shw_port_priv;
>
> That's very strange this file is using some (wrong) doxygen syntax.
> I'll fix this one when applying.
Many thanks for fixing it.
> A cleanup may be needed for other comments in the file.
Will do.

Thanks,
Dongdong
>
>>  /**< Enable show tm. */
>>  static uint32_t enable_shw_tm;
>>  /**< Enable show crypto. */
>
>
>
> .
>
  

Patch

diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index 56070a3317..1d350291b9 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -84,6 +84,8 @@  static char bdr_str[MAX_STRING_LEN];
 
 /**< Enable show port. */
 static uint32_t enable_shw_port;
+/**< Enable show port private info. */
+static uint32_t enable_shw_port_priv;
 /**< Enable show tm. */
 static uint32_t enable_shw_tm;
 /**< Enable show crypto. */
@@ -123,6 +125,7 @@  proc_info_usage(const char *prgname)
 		"  --collectd-format: to print statistics to STDOUT in expected by collectd format\n"
 		"  --host-id STRING: host id used to identify the system process is running on\n"
 		"  --show-port: to display ports information\n"
+		"  --show-port-private: to display ports private information\n"
 		"  --show-tm: to display traffic manager information for ports\n"
 		"  --show-crypto: to display crypto information\n"
 		"  --show-ring[=name]: to display ring information\n"
@@ -232,6 +235,7 @@  proc_info_parse_args(int argc, char **argv)
 		{"xstats-ids", 1, NULL, 1},
 		{"host-id", 0, NULL, 0},
 		{"show-port", 0, NULL, 0},
+		{"show-port-private", 0, NULL, 0},
 		{"show-tm", 0, NULL, 0},
 		{"show-crypto", 0, NULL, 0},
 		{"show-ring", optional_argument, NULL, 0},
@@ -284,6 +288,9 @@  proc_info_parse_args(int argc, char **argv)
 			else if (!strncmp(long_option[option_index].name,
 					"show-port", MAX_LONG_OPT_SZ))
 				enable_shw_port = 1;
+			else if (!strncmp(long_option[option_index].name,
+					"show-port-private", MAX_LONG_OPT_SZ))
+				enable_shw_port_priv = 1;
 			else if (!strncmp(long_option[option_index].name,
 					"show-tm", MAX_LONG_OPT_SZ))
 				enable_shw_tm = 1;
@@ -887,6 +894,25 @@  show_port(void)
 	}
 }
 
+static void
+show_port_private_info(void)
+{
+	int i;
+
+	snprintf(bdr_str, MAX_STRING_LEN, " Dump - Ports private information");
+	STATS_BDR_STR(10, bdr_str);
+
+	RTE_ETH_FOREACH_DEV(i) {
+		/* Skip if port is not in mask */
+		if ((enabled_port_mask & (1ul << i)) == 0)
+			continue;
+
+		snprintf(bdr_str, MAX_STRING_LEN, " Port %u ", i);
+		STATS_BDR_STR(5, bdr_str);
+		rte_eth_dev_priv_dump(i, stdout);
+	}
+}
+
 static void
 display_nodecap_info(int is_leaf, struct rte_tm_node_capabilities *cap)
 {
@@ -1549,6 +1575,8 @@  main(int argc, char **argv)
 	/* show information for PMD */
 	if (enable_shw_port)
 		show_port();
+	if (enable_shw_port_priv)
+		show_port_private_info();
 	if (enable_shw_tm)
 		show_tm();
 	if (enable_shw_crypto)