automatic DPDK test reports
 help / color / mirror / Atom feed
* |WARNING| pw123367 [PATCH] [v9, 2/5] eal: report applications lcore usage
@ 2023-02-07 21:17 dpdklab
  0 siblings, 0 replies; only message in thread
From: dpdklab @ 2023-02-07 21:17 UTC (permalink / raw)
  To: test-report; +Cc: dpdk-test-reports

[-- Attachment #1: Type: text/plain, Size: 4342 bytes --]

Test-Label: iol-testing
Test-Status: WARNING
http://dpdk.org/patch/123367

_apply patch failure_

Submitter: Robin Jarry <rjarry@redhat.com>
Date: Tuesday, February 07 2023 19:37:28 
Applied on: CommitID:56ee8af9fd80493a9dd888ccc01ef4f1db02e491
Apply patch set 123367 failed:

Checking patch doc/guides/rel_notes/release_23_03.rst...
Checking patch lib/eal/common/eal_common_lcore.c...
error: while searching for:
	}
}

static int
lcore_dump_cb(unsigned int lcore_id, void *arg)
{
	struct rte_config *cfg = rte_eal_get_configuration();
	char cpuset[RTE_CPU_AFFINITY_STR_LEN];
	FILE *f = arg;
	int ret;

	ret = eal_thread_dump_affinity(&lcore_config[lcore_id].cpuset, cpuset,
		sizeof(cpuset));
	fprintf(f, "lcore %u, socket %u, role %s, cpuset %s%s\n", lcore_id,
		rte_lcore_to_socket_id(lcore_id),
		lcore_role_str(cfg->lcore_role[lcore_id]),
		cpuset, ret == 0 ? "" : "...");
	return 0;
}


error: patch failed: lib/eal/common/eal_common_lcore.c:437
error: while searching for:
{
	struct rte_config *cfg = rte_eal_get_configuration();
	struct lcore_telemetry_info *info = arg;
	struct rte_tel_data *cpuset;
	unsigned int cpu;

	if (info->lcore_id != lcore_id)

error: patch failed: lib/eal/common/eal_common_lcore.c:489
error: while searching for:
			rte_tel_data_add_array_int(cpuset, cpu);
	}
	rte_tel_data_add_dict_container(info->d, "cpuset", cpuset, 0);

	return 0;
}

error: patch failed: lib/eal/common/eal_common_lcore.c:508
Checking patch lib/eal/include/rte_lcore.h...
Checking patch lib/eal/version.map...
Applied patch doc/guides/rel_notes/release_23_03.rst cleanly.
Applying patch lib/eal/common/eal_common_lcore.c with 3 rejects...
Hunk #1 applied cleanly.
Rejected hunk #2.
Rejected hunk #3.
Rejected hunk #4.
Applied patch lib/eal/include/rte_lcore.h cleanly.
Applied patch lib/eal/version.map cleanly.
diff a/lib/eal/common/eal_common_lcore.c b/lib/eal/common/eal_common_lcore.c	(rejected hunks)
@@ -437,20 +438,45 @@ lcore_role_str(enum rte_lcore_role_t role)
 	}
 }
 
+static rte_lcore_usage_cb lcore_usage_cb;
+
+void
+rte_lcore_register_usage_cb(rte_lcore_usage_cb cb)
+{
+	lcore_usage_cb = cb;
+}
+
 static int
 lcore_dump_cb(unsigned int lcore_id, void *arg)
 {
 	struct rte_config *cfg = rte_eal_get_configuration();
 	char cpuset[RTE_CPU_AFFINITY_STR_LEN];
+	struct rte_lcore_usage usage;
+	rte_lcore_usage_cb usage_cb;
+	char *usage_str = NULL;
 	FILE *f = arg;
 	int ret;
 
+	/* The callback may not set all the fields in the structure, so clear it here. */
+	memset(&usage, 0, sizeof(usage));
+	/* Guard against concurrent modification of lcore_usage_cb. */
+	usage_cb = lcore_usage_cb;
+	if (usage_cb != NULL && usage_cb(lcore_id, &usage) == 0) {
+		if (asprintf(&usage_str, ", busy cycles %"PRIu64"/%"PRIu64,
+				usage.busy_cycles, usage.total_cycles) < 0) {
+			return -ENOMEM;
+		}
+	}
 	ret = eal_thread_dump_affinity(&lcore_config[lcore_id].cpuset, cpuset,
 		sizeof(cpuset));
-	fprintf(f, "lcore %u, socket %u, role %s, cpuset %s%s\n", lcore_id,
+	fprintf(f, "lcore %u, socket %u, role %s, cpuset %s%s%s\n", lcore_id,
 		rte_lcore_to_socket_id(lcore_id),
 		lcore_role_str(cfg->lcore_role[lcore_id]),
-		cpuset, ret == 0 ? "" : "...");
+		cpuset, ret == 0 ? "" : "...",
+		usage_str != NULL ? usage_str : "");
+
+	free(usage_str);
+
 	return 0;
 }
 
@@ -489,7 +515,9 @@ lcore_telemetry_info_cb(unsigned int lcore_id, void *arg)
 {
 	struct rte_config *cfg = rte_eal_get_configuration();
 	struct lcore_telemetry_info *info = arg;
+	struct rte_lcore_usage usage;
 	struct rte_tel_data *cpuset;
+	rte_lcore_usage_cb usage_cb;
 	unsigned int cpu;
 
 	if (info->lcore_id != lcore_id)
@@ -508,6 +536,14 @@ lcore_telemetry_info_cb(unsigned int lcore_id, void *arg)
 			rte_tel_data_add_array_int(cpuset, cpu);
 	}
 	rte_tel_data_add_dict_container(info->d, "cpuset", cpuset, 0);
+	/* The callback may not set all the fields in the structure, so clear it here. */
+	memset(&usage, 0, sizeof(usage));
+	/* Guard against concurrent modification of lcore_usage_cb. */
+	usage_cb = lcore_usage_cb;
+	if (usage_cb != NULL && usage_cb(lcore_id, &usage) == 0) {
+		rte_tel_data_add_dict_uint(info->d, "total_cycles", usage.total_cycles);
+		rte_tel_data_add_dict_uint(info->d, "busy_cycles", usage.busy_cycles);
+	}
 
 	return 0;
 }

https://lab.dpdk.org/results/dashboard/patchsets/25274/

UNH-IOL DPDK Community Lab

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-07 21:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-07 21:17 |WARNING| pw123367 [PATCH] [v9, 2/5] eal: report applications lcore usage dpdklab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).