[v5,4/7] compressdev: remove driver name from logs

Message ID 20181014204747.26621-5-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v5,1/7] net/mlx5: remove useless driver name comparison |

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Thomas Monjalon Oct. 14, 2018, 8:47 p.m. UTC
  The logs printed by COMPRESSDEV_LOG were prefixed with the driver name.

In order to avoid assigning the driver before the end of the probing,
the driver name is removed from the compressdev library logs.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 lib/librte_compressdev/rte_compressdev_pmd.c | 23 ++++++++------------
 1 file changed, 9 insertions(+), 14 deletions(-)
  

Comments

Thomas Monjalon Oct. 15, 2018, 8:51 a.m. UTC | #1
+Cc Fiona and Ashish

14/10/2018 22:47, Thomas Monjalon:
> The logs printed by COMPRESSDEV_LOG were prefixed with the driver name.
> 
> In order to avoid assigning the driver before the end of the probing,
> the driver name is removed from the compressdev library logs.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  lib/librte_compressdev/rte_compressdev_pmd.c | 23 ++++++++------------
>  1 file changed, 9 insertions(+), 14 deletions(-)
> 
> diff --git a/lib/librte_compressdev/rte_compressdev_pmd.c b/lib/librte_compressdev/rte_compressdev_pmd.c
> index 7de4f339e..95beb26ab 100644
> --- a/lib/librte_compressdev/rte_compressdev_pmd.c
> +++ b/lib/librte_compressdev/rte_compressdev_pmd.c
> @@ -92,24 +92,20 @@ rte_compressdev_pmd_create(const char *name,
>  	struct rte_compressdev *compressdev;
>  
>  	if (params->name[0] != '\0') {
> -		COMPRESSDEV_LOG(INFO, "[%s] User specified device name = %s\n",
> -				device->driver->name, params->name);
> +		COMPRESSDEV_LOG(INFO, "User specified device name = %s\n",
> +				params->name);
>  		name = params->name;
>  	}
>  
> -	COMPRESSDEV_LOG(INFO, "[%s] - Creating compressdev %s\n",
> -			device->driver->name, name);
> +	COMPRESSDEV_LOG(INFO, "Creating compressdev %s\n", name);
>  
> -	COMPRESSDEV_LOG(INFO,
> -	"[%s] - Init parameters - name: %s, socket id: %d",
> -			device->driver->name, name,
> -			params->socket_id);
> +	COMPRESSDEV_LOG(INFO, "Init parameters - name: %s, socket id: %d",
> +			name, params->socket_id);
>  
>  	/* allocate device structure */
>  	compressdev = rte_compressdev_pmd_allocate(name, params->socket_id);
>  	if (compressdev == NULL) {
> -		COMPRESSDEV_LOG(ERR, "[%s] Failed to allocate comp device %s",
> -				device->driver->name, name);
> +		COMPRESSDEV_LOG(ERR, "Failed to allocate comp device %s", name);
>  		return NULL;
>  	}
>  
> @@ -123,8 +119,8 @@ rte_compressdev_pmd_create(const char *name,
>  
>  		if (compressdev->data->dev_private == NULL) {
>  			COMPRESSDEV_LOG(ERR,
> -		"[%s] Cannot allocate memory for compressdev %s private data",
> -					device->driver->name, name);
> +					"Cannot allocate memory for compressdev"
> +					" %s private data", name);
>  
>  			rte_compressdev_pmd_release_device(compressdev);
>  			return NULL;
> @@ -141,8 +137,7 @@ rte_compressdev_pmd_destroy(struct rte_compressdev *compressdev)
>  {
>  	int retval;
>  
> -	COMPRESSDEV_LOG(INFO, "[%s] Closing comp device %s",
> -			compressdev->device->driver->name,
> +	COMPRESSDEV_LOG(INFO, "Closing comp device %s",
>  			compressdev->device->name);
>  
>  	/* free comp device */
>
  

Patch

diff --git a/lib/librte_compressdev/rte_compressdev_pmd.c b/lib/librte_compressdev/rte_compressdev_pmd.c
index 7de4f339e..95beb26ab 100644
--- a/lib/librte_compressdev/rte_compressdev_pmd.c
+++ b/lib/librte_compressdev/rte_compressdev_pmd.c
@@ -92,24 +92,20 @@  rte_compressdev_pmd_create(const char *name,
 	struct rte_compressdev *compressdev;
 
 	if (params->name[0] != '\0') {
-		COMPRESSDEV_LOG(INFO, "[%s] User specified device name = %s\n",
-				device->driver->name, params->name);
+		COMPRESSDEV_LOG(INFO, "User specified device name = %s\n",
+				params->name);
 		name = params->name;
 	}
 
-	COMPRESSDEV_LOG(INFO, "[%s] - Creating compressdev %s\n",
-			device->driver->name, name);
+	COMPRESSDEV_LOG(INFO, "Creating compressdev %s\n", name);
 
-	COMPRESSDEV_LOG(INFO,
-	"[%s] - Init parameters - name: %s, socket id: %d",
-			device->driver->name, name,
-			params->socket_id);
+	COMPRESSDEV_LOG(INFO, "Init parameters - name: %s, socket id: %d",
+			name, params->socket_id);
 
 	/* allocate device structure */
 	compressdev = rte_compressdev_pmd_allocate(name, params->socket_id);
 	if (compressdev == NULL) {
-		COMPRESSDEV_LOG(ERR, "[%s] Failed to allocate comp device %s",
-				device->driver->name, name);
+		COMPRESSDEV_LOG(ERR, "Failed to allocate comp device %s", name);
 		return NULL;
 	}
 
@@ -123,8 +119,8 @@  rte_compressdev_pmd_create(const char *name,
 
 		if (compressdev->data->dev_private == NULL) {
 			COMPRESSDEV_LOG(ERR,
-		"[%s] Cannot allocate memory for compressdev %s private data",
-					device->driver->name, name);
+					"Cannot allocate memory for compressdev"
+					" %s private data", name);
 
 			rte_compressdev_pmd_release_device(compressdev);
 			return NULL;
@@ -141,8 +137,7 @@  rte_compressdev_pmd_destroy(struct rte_compressdev *compressdev)
 {
 	int retval;
 
-	COMPRESSDEV_LOG(INFO, "[%s] Closing comp device %s",
-			compressdev->device->driver->name,
+	COMPRESSDEV_LOG(INFO, "Closing comp device %s",
 			compressdev->device->name);
 
 	/* free comp device */