MCPcopy Create free account
hub / github.com/F-Stack/f-stack / telemetry_legacy_init

Function telemetry_legacy_init

dpdk/lib/telemetry/telemetry.c:536–573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

534}
535
536static int
537telemetry_legacy_init(void)
538{
539 pthread_t t_old;
540 int rc;
541
542 if (num_legacy_callbacks == 1) {
543 TMTY_LOG(WARNING, "No legacy callbacks, legacy socket not created\n");
544 return -1;
545 }
546
547 v1_socket.fn = legacy_client_handler;
548 if ((size_t) snprintf(v1_socket.path, sizeof(v1_socket.path),
549 "%s/telemetry", socket_dir) >= sizeof(v1_socket.path)) {
550 TMTY_LOG(ERR, "Error with socket binding, path too long\n");
551 return -1;
552 }
553 v1_socket.sock = create_socket(v1_socket.path);
554 if (v1_socket.sock < 0) {
555 v1_socket.path[0] = '\0';
556 return -1;
557 }
558 rc = pthread_create(&t_old, NULL, socket_listener, &v1_socket);
559 if (rc != 0) {
560 TMTY_LOG(ERR, "Error with create legacy socket thread: %s\n",
561 strerror(rc));
562 close(v1_socket.sock);
563 v1_socket.sock = -1;
564 unlink(v1_socket.path);
565 v1_socket.path[0] = '\0';
566 return -1;
567 }
568 pthread_setaffinity_np(t_old, sizeof(*thread_cpuset), thread_cpuset);
569 set_thread_name(t_old, "dpdk-telemet-v1");
570 TMTY_LOG(DEBUG, "Legacy telemetry socket initialized ok\n");
571 pthread_detach(t_old);
572 return 0;
573}
574
575static int
576telemetry_v2_init(void)

Callers 1

rte_telemetry_initFunction · 0.85

Calls 5

snprintfFunction · 0.85
create_socketFunction · 0.85
set_thread_nameFunction · 0.85
pthread_createFunction · 0.50
closeFunction · 0.50

Tested by

no test coverage detected