projects
/
ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libustctl: use direct socket communication
[ust.git]
/
ustctl
/
ustctl.c
diff --git
a/ustctl/ustctl.c
b/ustctl/ustctl.c
index 2b75a58730b630c532e7d89f383725269b885bbc..b9acc238670ac13a3bd545fb330df5482b3ff26e 100644
(file)
--- a/
ustctl/ustctl.c
+++ b/
ustctl/ustctl.c
@@
-23,7
+23,7
@@
#include <stdlib.h>
#include <fcntl.h>
#include <stdlib.h>
#include <fcntl.h>
-#include "ust/ustc
md
.h"
+#include "ust/ustc
tl
.h"
#include "usterr.h"
#include "cli.h"
#include "scanning_functions.h"
#include "usterr.h"
#include "cli.h"
#include "scanning_functions.h"
@@
-106,36
+106,35
@@
int main(int argc, char *argv[])
static int list_trace_events(int argc, char *argv[])
{
struct trace_event_status *tes = NULL;
static int list_trace_events(int argc, char *argv[])
{
struct trace_event_status *tes = NULL;
- int i;
- pid_t pid;
+ int i, sock;
-
pid = parse
_pid(argv[1]);
+
sock = parse_and_connect
_pid(argv[1]);
- if (ustc
md_get_tes(&tes, pid
)) {
+ if (ustc
tl_get_tes(sock, &tes
)) {
ERR("error while trying to list "
ERR("error while trying to list "
- "trace_events for PID %
u
\n",
-
pid
);
+ "trace_events for PID %
s
\n",
+
argv[1]
);
return -1;
}
i = 0;
for (i = 0; tes[i].name; i++) {
return -1;
}
i = 0;
for (i = 0; tes[i].name; i++) {
- printf("{PID: %
u
, trace_event: %s}\n",
-
pid
,
+ printf("{PID: %
s
, trace_event: %s}\n",
+
argv[1]
,
tes[i].name);
}
tes[i].name);
}
- ustc
md
_free_tes(tes);
+ ustc
tl
_free_tes(tes);
return 0;
}
static int set_sock_path(int argc, char *argv[])
{
return 0;
}
static int set_sock_path(int argc, char *argv[])
{
-
pid_t pid
;
+
int sock
;
-
pid = parse
_pid(argv[1]);
+
sock = parse_and_connect
_pid(argv[1]);
- if (ustc
md_set_sock_path(argv[2], pid
)) {
- ERR("error while trying to set sock path for PID %
u\n", pid
);
+ if (ustc
tl_set_sock_path(sock, argv[2]
)) {
+ ERR("error while trying to set sock path for PID %
s\n", argv[1]
);
return -1;
}
return -1;
}
@@
-144,13
+143,13
@@
static int set_sock_path(int argc, char *argv[])
static int get_sock_path(int argc, char *argv[])
{
static int get_sock_path(int argc, char *argv[])
{
-
pid_t pid
;
+
int sock
;
char *sock_path;
char *sock_path;
-
pid = parse
_pid(argv[1]);
+
sock = parse_and_connect
_pid(argv[1]);
- if (ustc
md_get_sock_path(&sock_path, pid
)) {
- ERR("error while trying to get sock path for PID %
u\n", pid
);
+ if (ustc
tl_get_sock_path(sock, &sock_path
)) {
+ ERR("error while trying to get sock path for PID %
s\n", argv[1]
);
return -1;
}
printf("The socket path is %s\n", sock_path);
return -1;
}
printf("The socket path is %s\n", sock_path);
This page took
0.024082 seconds
and
4
git commands to generate.