aboutsummaryrefslogtreecommitdiffstats
path: root/src/procqueue.c
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-09-09 21:44:16 +0300
committerVadim Yanitskiy <axilirator@gmail.com>2017-12-31 12:20:59 +0100
commit459791c488c6b66a5cd0d7cff9392a7a0b8ca733 (patch)
treeac36081f2321258247c101d53eeac7744a8e403c /src/procqueue.c
parent408be3638b3cd84462632ae8fe0b92e93064ca57 (diff)
procqueue: add item catedory and sub-category fields
This change adds two meta-information fields to the processing queue item structure. Both of them will be used for more detailed logging and for the human-readable processing queue description.
Diffstat (limited to 'src/procqueue.c')
-rw-r--r--src/procqueue.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/procqueue.c b/src/procqueue.c
index 2c7b7fc..4de7a6a 100644
--- a/src/procqueue.c
+++ b/src/procqueue.c
@@ -176,3 +176,20 @@ osmo_gapk_pq_execute(struct osmo_gapk_pq *pq)
return 0;
}
+
+char *
+osmo_gapk_pq_describe(struct osmo_gapk_pq *pq)
+{
+ struct osmo_gapk_pq_item *item;
+ char *result = NULL;
+ int i = 0;
+
+ /* Iterate over all items in queue */
+ llist_for_each_entry(item, &pq->items, list) {
+ result = talloc_asprintf_append(result, "%s/%s%s",
+ item->cat_name, item->sub_name,
+ ++i < pq->n_items ? " -> " : "");
+ }
+
+ return result;
+}