[Sound-open-firmware] [PATCH] core: make sure we emit trace errors for when returning error values.

Liam Girdwood liam.r.girdwood at linux.intel.com
Fri Sep 8 15:44:51 CEST 2017


Makes debug easier.

Signed-off-by: Liam Girdwood <liam.r.girdwood at linux.intel.com>
---
 src/audio/component.c |  1 +
 src/audio/pipeline.c  | 21 ++++++++++++++-------
 src/ipc/intel-ipc.c   |  1 +
 3 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/src/audio/component.c b/src/audio/component.c
index 232ef02..2a397d7 100644
--- a/src/audio/component.c
+++ b/src/audio/component.c
@@ -148,6 +148,7 @@ int comp_set_state(struct comp_dev *dev, int cmd)
 		break;
 	default:
 		trace_comp_error("CEd");
+		trace_value(cmd);
 		ret = -EINVAL;
 		break;
 	}
diff --git a/src/audio/pipeline.c b/src/audio/pipeline.c
index 9aedc21..687efe9 100644
--- a/src/audio/pipeline.c
+++ b/src/audio/pipeline.c
@@ -465,7 +465,7 @@ static int preload_downstream(struct comp_dev *start, struct comp_dev *current)
 	struct list_item *clist;
 	int i, total = 0, count = 0;
 
-	trace_pipe("PR-");
+	tracev_pipe("PR-");
 	tracev_value(current->comp.id);
 
 	/* reached endpoint ? */
@@ -574,8 +574,11 @@ int pipeline_cmd(struct pipeline *p, struct comp_dev *host, int cmd,
 		ret = component_op_upstream(&op_data, host, host, NULL);
 	}
 
-	if (ret < 0)
-		trace_ipc_error("pae");
+	if (ret < 0) {
+		trace_ipc_error("pc0");
+		trace_value(host->comp.id);
+		trace_value(cmd);
+	}
 
 	spin_unlock(&p->lock);
 	return ret;
@@ -617,8 +620,10 @@ int pipeline_params(struct pipeline *p, struct comp_dev *host,
 		ret = component_op_upstream(&op_data, host, host, NULL);
 	}
 
-	if (ret < 0)
-		trace_ipc_error("pae");
+	if (ret < 0) {
+		trace_ipc_error("pp0");
+		trace_value(host->comp.id);
+	}
 
 	spin_unlock(&p->lock);
 	return ret;
@@ -645,8 +650,10 @@ int pipeline_reset(struct pipeline *p, struct comp_dev *host)
 		ret = component_op_upstream(&op_data, host, host, NULL);
 	}
 
-	if (ret < 0)
-		trace_ipc_error("pae");
+	if (ret < 0) {
+		trace_ipc_error("pr0");
+		trace_value(host->comp.id);
+	}
 
 	spin_unlock(&p->lock);
 	return ret;
diff --git a/src/ipc/intel-ipc.c b/src/ipc/intel-ipc.c
index 3912174..18d8732 100644
--- a/src/ipc/intel-ipc.c
+++ b/src/ipc/intel-ipc.c
@@ -567,6 +567,7 @@ static int ipc_comp_value(uint32_t header, uint32_t cmd)
 	stream_dev = ipc_get_comp(_ipc, data->comp_id);
 	if (stream_dev == NULL){
 		trace_ipc_error("eVg");
+		trace_value(data->comp_id);
 		return -ENODEV;
 	}
 	
-- 
2.11.0



More information about the Sound-open-firmware mailing list