+/*
+ * DA probe
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ *
+ * Nikita Kalyazin <n.kalyazin@samsung.com>
+ * Anastasia Lyupa <a.lyupa@samsung.com>
+ *
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Contributors:
+ * - Samsung RnD Institute Russia
+ *
+ */
+
#ifndef __BIN_PROTO_H__
#define __BIN_PROTO_H__
#include <sys/time.h>
+#include <sys/socket.h>
+#include "dahelper.h"
+
#define MSG_PROBE_MEMORY 0x3001
#define MSG_PROBE_UICONTROL 0x3002
#define MSG_PROBE_UIEVENT 0x3003
BUF_PTR = pack_int32(BUF_PTR, api_type); \
} while (0)
-#define LOG_PATH "/tmp/trace.bin"
-#define OPEN_LOG() \
- do { \
- log_fd = creat(LOG_PATH, 0644); \
- if (log_fd == -1) { \
- exit(1); \
- } \
- } while (0)
-#define CLOSE_LOG() \
- do { \
- if (log_fd > 0) { \
- close(log_fd); \
- } \
- } while (0)
-
-
-
#define LOCAL_BUF_SIZE 1024
#define PREPARE_LOCAL_BUF() \
char buf[LOCAL_BUF_SIZE]; \
#define MSG_HDR_LEN 20
#define FLUSH_LOCAL_BUF() \
*(uint32_t *)(buf + MSG_LEN_OFFSET) = (p - buf) - MSG_HDR_LEN; \
- write(log_fd, buf, p - buf);
+ send(gTraceInfo.socket.daemonSock, buf, (p - buf), 0);
// =========================== post block macro ===========================
} \
errno = (newerrno != 0) ? newerrno : olderrno
-/* data */
-extern int log_fd;
-
/* int main(int argc, char **argv) */
/* { */
/* char buf[1024]; */