v1.3.4-11,da-tool support first core without sched
(cherry picked from commit ef171acb6654538b62efb0106ed35e08c017627b)
This commit is contained in:
parent
1a706b5b7b
commit
917f3f4513
443
0011-fix-valid-time-of-pid-at-first-core-and-add-case.patch
Normal file
443
0011-fix-valid-time-of-pid-at-first-core-and-add-case.patch
Normal file
@ -0,0 +1,443 @@
|
|||||||
|
From 2e77a22e9bda4a3b7caeaa772dfb360470c7dacb Mon Sep 17 00:00:00 2001
|
||||||
|
From: LHesperus <2639350497@qq.com>
|
||||||
|
Date: Tue, 28 Nov 2023 09:42:00 +0800
|
||||||
|
Subject: [PATCH] fix valid time of pid at first core and add case
|
||||||
|
|
||||||
|
---
|
||||||
|
extra-tools/da-tool/analysis/time_pair.cpp | 8 +-
|
||||||
|
extra-tools/da-tool/analysis/time_pair.h | 7 --
|
||||||
|
.../da-tool/analysis/trace_resolve.cpp | 6 +-
|
||||||
|
extra-tools/da-tool/script/da-tool.sh | 4 +-
|
||||||
|
.../da-tool/test/case/case2/case2_udp_cli.c | 2 +-
|
||||||
|
extra-tools/da-tool/test/case/case3/case3.cpp | 33 +++++++
|
||||||
|
.../da-tool/test/case/case4/case4_udp_cli.c | 37 ++++++++
|
||||||
|
.../test/case/case4/case4_udp_ser_blk.c | 49 +++++++++++
|
||||||
|
.../da-tool/test/case/case5/case5_udp_cli.c | 81 +++++++++++++++++
|
||||||
|
.../da-tool/test/case/case5/case5_udp_ser.c | 88 +++++++++++++++++++
|
||||||
|
10 files changed, 300 insertions(+), 15 deletions(-)
|
||||||
|
create mode 100644 extra-tools/da-tool/test/case/case3/case3.cpp
|
||||||
|
create mode 100644 extra-tools/da-tool/test/case/case4/case4_udp_cli.c
|
||||||
|
create mode 100644 extra-tools/da-tool/test/case/case4/case4_udp_ser_blk.c
|
||||||
|
create mode 100644 extra-tools/da-tool/test/case/case5/case5_udp_cli.c
|
||||||
|
create mode 100644 extra-tools/da-tool/test/case/case5/case5_udp_ser.c
|
||||||
|
|
||||||
|
diff --git a/extra-tools/da-tool/analysis/time_pair.cpp b/extra-tools/da-tool/analysis/time_pair.cpp
|
||||||
|
index 2c1f813..52aa6aa 100644
|
||||||
|
--- a/extra-tools/da-tool/analysis/time_pair.cpp
|
||||||
|
+++ b/extra-tools/da-tool/analysis/time_pair.cpp
|
||||||
|
@@ -162,7 +162,7 @@ void TimePair::timePairUpdateLoop(const int &pid, const int &functionIndex, cons
|
||||||
|
const FirstInfo &firstInfo = trace_resolve_inst.getTraceFirstInfo();
|
||||||
|
int coreIndex = line_info_tmp.core;
|
||||||
|
// This process cannot find the starting sched switch on this core, ignore trace after timestamp
|
||||||
|
- if (timestamp <= firstInfo.schedSwitchTime[coreIndex] && functionIndex != sched_switch_funcidx) {
|
||||||
|
+ if (timestamp <= firstInfo.schedSwitchTime[coreIndex] && functionIndex != sched_switch_funcidx && coreIndex != firstInfo.coreId) {
|
||||||
|
timePairMap[pid][functionIndex].minEndTimeInvalid = timestamp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -444,8 +444,10 @@ void TimePair::saveTimePairToFile()
|
||||||
|
for (const auto &funcInfo : processInfo.second) {
|
||||||
|
int pid = processInfo.first;
|
||||||
|
file << "pid:" << pid << "," << std::endl;
|
||||||
|
- file << "functionIndex:" << funcInfo.first << "," << cfg.IndexToFunction[funcInfo.first] << std::endl;
|
||||||
|
- file << "info num," << funcInfo.second.startTime.size() << ",valid info num," << funcInfo.second.callTimes << ",";
|
||||||
|
+ file << "functionIndex:" << funcInfo.first << "," << cfg.IndexToFunction[funcInfo.first] << ",";
|
||||||
|
+ file << "maxStartTimeInvaild:" << funcInfo.second.maxStartTimeInvaild << ",";
|
||||||
|
+ file << "minEndTimeInvalid:" << funcInfo.second.minEndTimeInvalid << "," << std::endl;
|
||||||
|
+ file << "info num," << funcInfo.second.startTime.size() << ",valid info num," << funcInfo.second.summary.callTimes[DELAY_INFO_ALL] << ",";
|
||||||
|
file << "validStartTime," << validTimeOfPid[pid].validStartTime << ",validEndTime," << validTimeOfPid[pid].validEndTime << std::endl;
|
||||||
|
file << "startTime" << ",";
|
||||||
|
for (const auto &startTime : funcInfo.second.startTime) {
|
||||||
|
diff --git a/extra-tools/da-tool/analysis/time_pair.h b/extra-tools/da-tool/analysis/time_pair.h
|
||||||
|
index 9d3e757..ba0b784 100644
|
||||||
|
--- a/extra-tools/da-tool/analysis/time_pair.h
|
||||||
|
+++ b/extra-tools/da-tool/analysis/time_pair.h
|
||||||
|
@@ -76,13 +76,6 @@ public:
|
||||||
|
|
||||||
|
// analysis result
|
||||||
|
TimePairSummary summary;
|
||||||
|
- double aveDelay;
|
||||||
|
- int maxDelay;
|
||||||
|
- int minDelay;
|
||||||
|
- int delaySum;
|
||||||
|
- int maxDelayPos;
|
||||||
|
- int minDelayPos;
|
||||||
|
- int callTimes;
|
||||||
|
};
|
||||||
|
|
||||||
|
class TimePair {
|
||||||
|
diff --git a/extra-tools/da-tool/analysis/trace_resolve.cpp b/extra-tools/da-tool/analysis/trace_resolve.cpp
|
||||||
|
index 38e6d2b..61f0a74 100644
|
||||||
|
--- a/extra-tools/da-tool/analysis/trace_resolve.cpp
|
||||||
|
+++ b/extra-tools/da-tool/analysis/trace_resolve.cpp
|
||||||
|
@@ -131,8 +131,9 @@ void TraceResolve::resolveTrace()
|
||||||
|
}
|
||||||
|
if (line_num % 10000 == 0) {
|
||||||
|
double rate = (line_num - cfg.readTraceBegin) * 1.0/ readTraceLen;
|
||||||
|
- std::cout << "[Resolve] " << std::fixed << std::setprecision(3) << rate * 100 << "%, ";
|
||||||
|
- std::cout << "Match " << regex_num << std::endl;
|
||||||
|
+ std::cout << "\r" << "[Resolve] " << std::fixed << std::setprecision(3) << rate * 100 << "%, ";
|
||||||
|
+ std::cout << "Match " << regex_num;
|
||||||
|
+ std::cout.flush();
|
||||||
|
}
|
||||||
|
if (cfg.readTraceLen != 0 && line_num > cfg.readTraceBegin + cfg.readTraceLen) {
|
||||||
|
break;
|
||||||
|
@@ -202,6 +203,7 @@ void TraceResolve::resolveTrace()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (traceLineVec.size() > 0) {
|
||||||
|
+ std::cout << std::endl;
|
||||||
|
std::cout << "[INFO] trace delay : " << traceLineVec[traceLineVec.size() - 1].timestamp - traceLineVec[0].timestamp << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/extra-tools/da-tool/script/da-tool.sh b/extra-tools/da-tool/script/da-tool.sh
|
||||||
|
index 14fd009..2b38bc8 100755
|
||||||
|
--- a/extra-tools/da-tool/script/da-tool.sh
|
||||||
|
+++ b/extra-tools/da-tool/script/da-tool.sh
|
||||||
|
@@ -182,10 +182,10 @@ function arr_check_function_support() {
|
||||||
|
function arr_check_kernel_symbols_exist() {
|
||||||
|
local symbols_tmp=("$@")
|
||||||
|
for symbol in "${symbols_tmp[@]}"; do
|
||||||
|
- if grep "\<$symbol\>" /proc/kallsyms >/dev/null; then
|
||||||
|
+ if grep -e "^[0-9a-fA-F]* [a-zA-Z] $symbol$" /proc/kallsyms >/dev/null; then
|
||||||
|
echo "$symbol exist in /proc/kallsyms" >>$sample_log
|
||||||
|
else
|
||||||
|
- echo "$symbol does not exist in /proc/kallsyms, please check '$config_file'!!!" | tee -a $sample_log
|
||||||
|
+ echo "$symbol does not exist in /proc/kallsyms or not support, please check '$config_file'!!!" | tee -a $sample_log
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
diff --git a/extra-tools/da-tool/test/case/case2/case2_udp_cli.c b/extra-tools/da-tool/test/case/case2/case2_udp_cli.c
|
||||||
|
index 80f9dd7..1a2a346 100644
|
||||||
|
--- a/extra-tools/da-tool/test/case/case2/case2_udp_cli.c
|
||||||
|
+++ b/extra-tools/da-tool/test/case/case2/case2_udp_cli.c
|
||||||
|
@@ -25,7 +25,7 @@ int main() {
|
||||||
|
server_addr.sin_addr.s_addr = inet_addr(SERVER_IP);
|
||||||
|
server_addr.sin_port = htons(SERVER_PORT);
|
||||||
|
|
||||||
|
- int loop_num =0;
|
||||||
|
+ int loop_num = 0;
|
||||||
|
while (1) {
|
||||||
|
usleep(50000);
|
||||||
|
sprintf(buffer, "loop num : %d", loop_num++);
|
||||||
|
diff --git a/extra-tools/da-tool/test/case/case3/case3.cpp b/extra-tools/da-tool/test/case/case3/case3.cpp
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..d6f154f
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/extra-tools/da-tool/test/case/case3/case3.cpp
|
||||||
|
@@ -0,0 +1,33 @@
|
||||||
|
+#include <iostream>
|
||||||
|
+#include <vector>
|
||||||
|
+#include <random>
|
||||||
|
+#include <algorithm>
|
||||||
|
+
|
||||||
|
+void sortArray(std::vector<int> &arr)
|
||||||
|
+{
|
||||||
|
+ std::sort(arr.begin(), arr.end());
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int main() {
|
||||||
|
+ std::random_device rd;
|
||||||
|
+ std::mt19937 gen(rd());
|
||||||
|
+ std::uniform_int_distribution<int> dis(1, 100);
|
||||||
|
+ const int count = 100000;
|
||||||
|
+ std::vector<int> numbers;
|
||||||
|
+ numbers.resize(count);
|
||||||
|
+ int loopCnt = 0;
|
||||||
|
+ while(1)
|
||||||
|
+ {
|
||||||
|
+ loopCnt++;
|
||||||
|
+ for (int i = 0; i < count; ++i) {
|
||||||
|
+ int randomNum = dis(gen);
|
||||||
|
+ numbers[i] = randomNum;
|
||||||
|
+ }
|
||||||
|
+ sortArray(numbers);
|
||||||
|
+ std::cout<< "loopCnt:" << loopCnt << std::endl;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+// _Z9sortArrayRSt6vectorIiSaIiEE
|
||||||
|
\ No newline at end of file
|
||||||
|
diff --git a/extra-tools/da-tool/test/case/case4/case4_udp_cli.c b/extra-tools/da-tool/test/case/case4/case4_udp_cli.c
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..1a2a346
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/extra-tools/da-tool/test/case/case4/case4_udp_cli.c
|
||||||
|
@@ -0,0 +1,37 @@
|
||||||
|
+#include <stdio.h>
|
||||||
|
+#include <stdlib.h>
|
||||||
|
+#include <string.h>
|
||||||
|
+#include <unistd.h>
|
||||||
|
+#include <sys/socket.h>
|
||||||
|
+#include <netinet/in.h>
|
||||||
|
+#include <arpa/inet.h>
|
||||||
|
+
|
||||||
|
+#define SERVER_IP "127.0.0.1"
|
||||||
|
+#define SERVER_PORT 12345
|
||||||
|
+
|
||||||
|
+int main() {
|
||||||
|
+ int sockfd;
|
||||||
|
+ struct sockaddr_in server_addr;
|
||||||
|
+ char buffer[1024];
|
||||||
|
+
|
||||||
|
+ sockfd = socket(AF_INET, SOCK_DGRAM, 0);
|
||||||
|
+ if (sockfd < 0) {
|
||||||
|
+ perror("socket creation failed");
|
||||||
|
+ exit(EXIT_FAILURE);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ memset(&server_addr, 0, sizeof(server_addr));
|
||||||
|
+ server_addr.sin_family = AF_INET;
|
||||||
|
+ server_addr.sin_addr.s_addr = inet_addr(SERVER_IP);
|
||||||
|
+ server_addr.sin_port = htons(SERVER_PORT);
|
||||||
|
+
|
||||||
|
+ int loop_num = 0;
|
||||||
|
+ while (1) {
|
||||||
|
+ usleep(50000);
|
||||||
|
+ sprintf(buffer, "loop num : %d", loop_num++);
|
||||||
|
+ sendto(sockfd, buffer, strlen(buffer), 0, (const struct sockaddr *)&server_addr, sizeof(server_addr));
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ close(sockfd);
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
diff --git a/extra-tools/da-tool/test/case/case4/case4_udp_ser_blk.c b/extra-tools/da-tool/test/case/case4/case4_udp_ser_blk.c
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..faad6e1
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/extra-tools/da-tool/test/case/case4/case4_udp_ser_blk.c
|
||||||
|
@@ -0,0 +1,49 @@
|
||||||
|
+#include <stdio.h>
|
||||||
|
+#include <stdlib.h>
|
||||||
|
+#include <string.h>
|
||||||
|
+#include <unistd.h>
|
||||||
|
+#include <sys/socket.h>
|
||||||
|
+#include <netinet/in.h>
|
||||||
|
+#include <arpa/inet.h>
|
||||||
|
+
|
||||||
|
+#define SERVER_PORT 12345
|
||||||
|
+
|
||||||
|
+int main() {
|
||||||
|
+ int sockfd;
|
||||||
|
+ struct sockaddr_in server_addr, client_addr;
|
||||||
|
+ socklen_t client_len;
|
||||||
|
+ char buffer[1024];
|
||||||
|
+
|
||||||
|
+ sockfd = socket(AF_INET, SOCK_DGRAM, 0);
|
||||||
|
+ if (sockfd < 0) {
|
||||||
|
+ perror("socket creation failed");
|
||||||
|
+ exit(EXIT_FAILURE);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ memset(&server_addr, 0, sizeof(server_addr));
|
||||||
|
+ server_addr.sin_family = AF_INET;
|
||||||
|
+ server_addr.sin_addr.s_addr = INADDR_ANY;
|
||||||
|
+ server_addr.sin_port = htons(SERVER_PORT);
|
||||||
|
+
|
||||||
|
+ if (bind(sockfd, (const struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) {
|
||||||
|
+ perror("bind failed");
|
||||||
|
+ exit(EXIT_FAILURE);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ while (1) {
|
||||||
|
+ memset(buffer, 0, sizeof(buffer));
|
||||||
|
+ client_len = sizeof(client_addr);
|
||||||
|
+ ssize_t recv_len = recvfrom(sockfd, buffer, sizeof(buffer) - 1, 0, (struct sockaddr *)&client_addr, &client_len);
|
||||||
|
+
|
||||||
|
+ if (recv_len > 0) {
|
||||||
|
+ buffer[recv_len] = '\0';
|
||||||
|
+ printf("recvfrom %s:%d date:%s\n", inet_ntoa(client_addr.sin_addr), ntohs(client_addr.sin_port), buffer);
|
||||||
|
+ } else {
|
||||||
|
+ printf("recv_len=%d\n", recv_len);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ close(sockfd);
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
diff --git a/extra-tools/da-tool/test/case/case5/case5_udp_cli.c b/extra-tools/da-tool/test/case/case5/case5_udp_cli.c
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..b8fdb4e
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/extra-tools/da-tool/test/case/case5/case5_udp_cli.c
|
||||||
|
@@ -0,0 +1,81 @@
|
||||||
|
+#include <stdio.h>
|
||||||
|
+#include <stdlib.h>
|
||||||
|
+#include <string.h>
|
||||||
|
+#include <unistd.h>
|
||||||
|
+#include <arpa/inet.h>
|
||||||
|
+#include <sys/socket.h>
|
||||||
|
+#include <netinet/in.h>
|
||||||
|
+#include <pthread.h>
|
||||||
|
+#define BUFFER_SIZE 1024
|
||||||
|
+#define PORT 8888
|
||||||
|
+
|
||||||
|
+void* sendRequest(void* arg) {
|
||||||
|
+ int clientSocket = *(int*)arg;
|
||||||
|
+
|
||||||
|
+ while (1) {
|
||||||
|
+ struct sockaddr_in serverAddress;
|
||||||
|
+ memset(&serverAddress, 0, sizeof(serverAddress));
|
||||||
|
+ serverAddress.sin_family = AF_INET;
|
||||||
|
+ serverAddress.sin_port = htons(PORT);
|
||||||
|
+
|
||||||
|
+ if (inet_pton(AF_INET, "127.0.0.1", &(serverAddress.sin_addr)) <= 0) {
|
||||||
|
+ perror("Invalid server address");
|
||||||
|
+ return NULL;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ // Send a message to the server
|
||||||
|
+ char* message = "Hello, Server!";
|
||||||
|
+ ssize_t sentBytes = sendto(clientSocket, message, strlen(message), 0,
|
||||||
|
+ (struct sockaddr*)&serverAddress, sizeof(serverAddress));
|
||||||
|
+
|
||||||
|
+ if (sentBytes < 0) {
|
||||||
|
+ perror("Sending message failed");
|
||||||
|
+ return NULL;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ printf("Sent message to server\n");
|
||||||
|
+
|
||||||
|
+ // Receive server response
|
||||||
|
+ char buffer[BUFFER_SIZE] = {0};
|
||||||
|
+ socklen_t serverAddressLength = sizeof(serverAddress);
|
||||||
|
+ ssize_t receivedBytes = recvfrom(clientSocket, buffer, BUFFER_SIZE, 0,
|
||||||
|
+ (struct sockaddr*)&serverAddress, &serverAddressLength);
|
||||||
|
+
|
||||||
|
+ if (receivedBytes < 0) {
|
||||||
|
+ perror("Receive response failed");
|
||||||
|
+ return NULL;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ printf("Received response from server:%s\n", buffer);
|
||||||
|
+
|
||||||
|
+ usleep(100000);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ close(clientSocket);
|
||||||
|
+
|
||||||
|
+ return NULL;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int main() {
|
||||||
|
+ int clientSocket = socket(AF_INET, SOCK_DGRAM, 0);
|
||||||
|
+ if (clientSocket == -1) {
|
||||||
|
+ perror("Unable to create socket");
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ const int numThreads = 5;
|
||||||
|
+ pthread_t tids[numThreads];
|
||||||
|
+
|
||||||
|
+ for (int i = 0; i < numThreads; ++i) {
|
||||||
|
+ if (pthread_create(&tids[i], NULL, sendRequest, &clientSocket) != 0) {
|
||||||
|
+ perror("Unable to create socket");
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ for (int i = 0; i < numThreads; ++i) {
|
||||||
|
+ pthread_join(tids[i], NULL);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
diff --git a/extra-tools/da-tool/test/case/case5/case5_udp_ser.c b/extra-tools/da-tool/test/case/case5/case5_udp_ser.c
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..5468bdb
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/extra-tools/da-tool/test/case/case5/case5_udp_ser.c
|
||||||
|
@@ -0,0 +1,88 @@
|
||||||
|
+#include <stdio.h>
|
||||||
|
+#include <stdlib.h>
|
||||||
|
+#include <string.h>
|
||||||
|
+#include <unistd.h>
|
||||||
|
+#include <arpa/inet.h>
|
||||||
|
+#include <sys/socket.h>
|
||||||
|
+#include <netinet/in.h>
|
||||||
|
+#include <pthread.h>
|
||||||
|
+#define BUFFER_SIZE 1024
|
||||||
|
+#define PORT 8888
|
||||||
|
+
|
||||||
|
+void* handleClient(void* arg) {
|
||||||
|
+ int serverSocket = *(int*)arg;
|
||||||
|
+
|
||||||
|
+ while (1) {
|
||||||
|
+
|
||||||
|
+ char buffer[BUFFER_SIZE] = {0};
|
||||||
|
+ struct sockaddr_in clientAddress;
|
||||||
|
+ socklen_t clientAddressLength = sizeof(clientAddress);
|
||||||
|
+ ssize_t receivedBytes = recvfrom(serverSocket, buffer, BUFFER_SIZE, 0,
|
||||||
|
+ (struct sockaddr*)&clientAddress, &clientAddressLength);
|
||||||
|
+
|
||||||
|
+ if (receivedBytes < 0) {
|
||||||
|
+ perror("Received message failed");
|
||||||
|
+ return NULL;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ printf("Received message from client:%s\n", buffer);
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+ char* response = "Hello, Client!";
|
||||||
|
+ ssize_t sentBytes = sendto(serverSocket, response, strlen(response), 0,
|
||||||
|
+ (struct sockaddr*)&clientAddress, clientAddressLength);
|
||||||
|
+
|
||||||
|
+ if (sentBytes < 0) {
|
||||||
|
+ perror("Sending response failed");
|
||||||
|
+ return NULL;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ printf("Response has been sent to the client\n");
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+ close(serverSocket);
|
||||||
|
+
|
||||||
|
+ return NULL;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int main() {
|
||||||
|
+
|
||||||
|
+ int serverSocket = socket(AF_INET, SOCK_DGRAM, 0);
|
||||||
|
+ if (serverSocket == -1) {
|
||||||
|
+ perror("Unable to create socket");
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+ struct sockaddr_in serverAddress;
|
||||||
|
+ memset(&serverAddress, 0, sizeof(serverAddress));
|
||||||
|
+ serverAddress.sin_family = AF_INET;
|
||||||
|
+ serverAddress.sin_addr.s_addr = INADDR_ANY;
|
||||||
|
+ serverAddress.sin_port = htons(PORT);
|
||||||
|
+
|
||||||
|
+ if (bind(serverSocket, (struct sockaddr*)&serverAddress, sizeof(serverAddress)) < 0) {
|
||||||
|
+ perror("Binding failed");
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ printf("Waiting for client connection\n");
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+ const int numThreads = 5;
|
||||||
|
+ pthread_t tids[numThreads];
|
||||||
|
+
|
||||||
|
+ for (int i = 0; i < numThreads; ++i) {
|
||||||
|
+ if (pthread_create(&tids[i], NULL, handleClient, &serverSocket) != 0) {
|
||||||
|
+ perror("Create thread failed");
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+ for (int i = 0; i < numThreads; ++i) {
|
||||||
|
+ pthread_join(tids[i], NULL);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
--
|
||||||
|
2.33.0
|
||||||
|
|
||||||
24
0012-update-doc-link.patch
Normal file
24
0012-update-doc-link.patch
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
From c5883ae776d766ed0516af636739e09dd5fda04b Mon Sep 17 00:00:00 2001
|
||||||
|
From: LHesperus <2639350497@qq.com>
|
||||||
|
Date: Tue, 28 Nov 2023 10:37:33 +0800
|
||||||
|
Subject: [PATCH] update doc link
|
||||||
|
|
||||||
|
---
|
||||||
|
extra-tools/da-tool/README.md | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/extra-tools/da-tool/README.md b/extra-tools/da-tool/README.md
|
||||||
|
index 157af65..c7a67db 100644
|
||||||
|
--- a/extra-tools/da-tool/README.md
|
||||||
|
+++ b/extra-tools/da-tool/README.md
|
||||||
|
@@ -29,6 +29,6 @@
|
||||||
|
|主题|内容简介|是否发布|
|
||||||
|
|:----|:-----|:----|
|
||||||
|
|[openEuler指南](https://gitee.com/openeuler/community/blob/master/zh/contributors/README.md)| 如何参与openEuler社区 | 已发布 |
|
||||||
|
-|[da-tool 使用指南](https://gitee.com/openeuler/docs/blob/stable2-20.03_LTS_SP3/docs/zh/docs/A-Ops/da-tool%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C.md)|1. 安装、配置和运行应用程序<br>2. 分析结果说明<br>3. 使用注意事项|已发布|
|
||||||
|
+|[时延分析工具 da-tool 使用手册](https://gitee.com/openeuler/docs/blob/stable2-20.03_LTS_SP4/docs/zh/docs/A-Ops/%E6%97%B6%E5%BB%B6%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7%20da-tool%20%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C.md)|1. 安装、配置和运行应用程序<br>2. 分析结果说明<br>3. 使用注意事项|已发布|
|
||||||
|
|da-tool设计文档|1. 技术原理<br> 2. 开发指南 |暂未发布|
|
||||||
|
|
||||||
|
--
|
||||||
|
2.33.0
|
||||||
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Name: aops-ceres
|
Name: aops-ceres
|
||||||
Version: v1.3.4
|
Version: v1.3.4
|
||||||
Release: 10
|
Release: 11
|
||||||
Summary: An agent which needs to be adopted in client, it managers some plugins, such as gala-gopher(kpi collection), fluentd(log collection) and so on.
|
Summary: An agent which needs to be adopted in client, it managers some plugins, such as gala-gopher(kpi collection), fluentd(log collection) and so on.
|
||||||
License: MulanPSL2
|
License: MulanPSL2
|
||||||
URL: https://gitee.com/openeuler/%{name}
|
URL: https://gitee.com/openeuler/%{name}
|
||||||
@ -17,6 +17,8 @@ Patch0007: 0007-add-usage-and-repet-config-check.patch
|
|||||||
Patch0008: 0008-add-command-check-config-check-test-case.patch
|
Patch0008: 0008-add-command-check-config-check-test-case.patch
|
||||||
Patch0009: 0009-Dealing-with-situations-where-sched-are-missing.patch
|
Patch0009: 0009-Dealing-with-situations-where-sched-are-missing.patch
|
||||||
Patch0010: 0010-Soft-links-for-documents.patch
|
Patch0010: 0010-Soft-links-for-documents.patch
|
||||||
|
Patch0011: 0011-fix-valid-time-of-pid-at-first-core-and-add-case.patch
|
||||||
|
Patch0012: 0012-update-doc-link.patch
|
||||||
|
|
||||||
BuildRequires: python3-setuptools
|
BuildRequires: python3-setuptools
|
||||||
Requires: python3-requests python3-jsonschema python3-libconf
|
Requires: python3-requests python3-jsonschema python3-libconf
|
||||||
@ -96,6 +98,10 @@ install -b -m755 ./extra-tools/da-tool/script/da-tool.sh ${RPM_BUILD_ROOT}
|
|||||||
%attr(755, root, root) %{_bindir}/da-tool-analysis
|
%attr(755, root, root) %{_bindir}/da-tool-analysis
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Nov 28 2023 liuchanggeng<liuchanggeng@huawei.com> - v1.3.4-11
|
||||||
|
- da-tool consider trace as valid data when first core lost scheduling information
|
||||||
|
- update document
|
||||||
|
|
||||||
* Mon Nov 27 2023 liuchanggeng<liuchanggeng@huawei.com> - v1.3.4-10
|
* Mon Nov 27 2023 liuchanggeng<liuchanggeng@huawei.com> - v1.3.4-10
|
||||||
- add check of command parameters and configuration files
|
- add check of command parameters and configuration files
|
||||||
- handling scenarios with lost scheduling information
|
- handling scenarios with lost scheduling information
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user