projects
/
ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Generalize some ustcomm functionality
[ust.git]
/
libustcmd
/
ustcmd.c
diff --git
a/libustcmd/ustcmd.c
b/libustcmd/ustcmd.c
index bffd3c237235144c12211e26b93246d15337811b..2c16e754da425d2f9c1fcc9b71fdb84f0db77347 100644
(file)
--- a/
libustcmd/ustcmd.c
+++ b/
libustcmd/ustcmd.c
@@
-303,12
+303,12
@@
int ustcmd_get_subbuf_size(const char *trace, const char *channel, pid_t pid)
static int do_trace_cmd(const char *trace, pid_t pid, int command)
{
struct ustcomm_header req_header, res_header;
static int do_trace_cmd(const char *trace, pid_t pid, int command)
{
struct ustcomm_header req_header, res_header;
- struct ustcomm_
trace_info
trace_inf;
+ struct ustcomm_
single_field
trace_inf;
int result;
int result;
- result = ustcomm_pack_
trace_info
(&req_header,
- &trace_inf,
- trace);
+ result = ustcomm_pack_
single_field
(&req_header,
+
&trace_inf,
+
trace);
if (result < 0) {
errno = -result;
return -1;
if (result < 0) {
errno = -result;
return -1;
@@
-607,20
+607,19
@@
int ustcmd_get_tes(struct trace_event_status **tes,
*/
int ustcmd_set_sock_path(const char *sock_path, pid_t pid)
{
*/
int ustcmd_set_sock_path(const char *sock_path, pid_t pid)
{
- int
offset = 0
;
+ int
result
;
struct ustcomm_header req_header, res_header;
struct ustcomm_header req_header, res_header;
- struct ustcomm_s
ock_path
sock_path_msg;
+ struct ustcomm_s
ingle_field
sock_path_msg;
-
sock_path_msg.sock_path = ustcomm_print_data(sock_path_msg.data
,
-
sizeof(sock_path_msg.data)
,
- &offset,
- sock_path);
- if (sock_path_msg.sock_path == USTCOMM_POISON_PTR) {
+
result = ustcomm_pack_single_field(&req_header
,
+
&sock_path_msg
,
+ sock_path);
+ if (result < 0) {
+ errno = -result;
return -1;
}
req_header.command = SET_SOCK_PATH;
return -1;
}
req_header.command = SET_SOCK_PATH;
- req_header.size = COMPUTE_MSG_SIZE(&sock_path_msg, offset);
return do_cmd(pid, &req_header, (char *)&sock_path_msg,
&res_header, NULL);
return do_cmd(pid, &req_header, (char *)&sock_path_msg,
&res_header, NULL);
@@
-637,7
+636,7
@@
int ustcmd_get_sock_path(char **sock_path, pid_t pid)
{
int result;
struct ustcomm_header req_header, res_header;
{
int result;
struct ustcomm_header req_header, res_header;
- struct ustcomm_s
ock_path
*sock_path_msg;
+ struct ustcomm_s
ingle_field
*sock_path_msg;
req_header.command = GET_SOCK_PATH;
req_header.size = 0;
req_header.command = GET_SOCK_PATH;
req_header.size = 0;
@@
-648,12
+647,12
@@
int ustcmd_get_sock_path(char **sock_path, pid_t pid)
return -1;
}
return -1;
}
- result = ustcomm_unpack_s
ock_path
(sock_path_msg);
+ result = ustcomm_unpack_s
ingle_field
(sock_path_msg);
if (result < 0) {
return result;
}
if (result < 0) {
return result;
}
- *sock_path = strdup(sock_path_msg->
sock_path
);
+ *sock_path = strdup(sock_path_msg->
field
);
free(sock_path_msg);
free(sock_path_msg);
This page took
0.026483 seconds
and
4
git commands to generate.