Fixed missing headers, consts and unused variable.
Fixed checkpatch warnings
Change-Id: Ica91fc8f50ece997a1752265a5a3e07bf919ac0a
Signed-off-by: Dmitry Bogatov <d.bogatov@samsung.com>
#include "ioctl_commands.h"
#include "debug.h"
#include "md5.h"
+#include "da_data.h"
#include <sys/stat.h>
#include <fcntl.h>
prof_session->running_status = 0;
}
-int check_running_status(struct prof_session_t *prof_session)
+int check_running_status(const struct prof_session_t *prof_session)
{
return prof_session->running_status;
}
static void get_file_md5sum(md5_byte_t digest[16], const char *filename)
{
- char buffer[1024];
+ md5_byte_t buffer[1024];
ssize_t size;
md5_state_t md5_state;
int fd = open(filename, O_RDONLY);
struct msg_t *msg_reply;
uint32_t serialized_time[2];
- if (check_running_status(&prof_session.conf) == 1) {
+ if (check_running_status(&prof_session) == 1) {
LOGW("Profiling has already been started\n");
goto send_ack;
}
err_code = ERR_NO;
send_ack:
- get_serialized_time(&serialized_time);
+ get_serialized_time(serialized_time);
sendACKToHost(NMSG_START, err_code, (void *)&serialized_time,
sizeof(serialized_time));
int host_message_handler(struct msg_t *msg)
{
- struct app_info_t app_info;
struct target_info_t target_info;
struct msg_t *msg_reply = NULL;
struct msg_buf_t msg_control;
enum ErrorCode error_code = ERR_NO;
int target_index;
- ssize_t sendlen;
msg_target_t sendlog;
LOGI("MY HANDLE %s (%X)\n", msg_ID_str(msg->id), msg->id);
void reset_msg(struct msg_t *msg);
void reset_replay_event_seq(struct replay_event_seq_t *res);
void reset_system_info(struct system_info_t *sys);
-int check_running_status(struct prof_session_t *prof_session);
+int check_running_status(const struct prof_session_t *prof_session);
extern struct prof_session_t prof_session;
if ((system_trace_period < CONF_SYSTRACE_PERIOD_MIN) ||
(system_trace_period > CONF_SYSTRACE_PERIOD_MAX))
{
- LOGE("wrong system trace period value %lu (0x%08X)\n",
- system_trace_period, system_trace_period);
+ LOGE("wrong system trace period value %u (0x%08X)\n",
+ (unsigned int) system_trace_period, system_trace_period);
res = 0;
}
if ((data_message_period < CONF_DATA_MSG_PERIOD_MIN) ||
(data_message_period > CONF_DATA_MSG_PERIOD_MAX))
{
- LOGE("wrong data message period value %lu (0x%08X)\n",
- data_message_period, data_message_period);
+ LOGE("wrong data message period value %u (0x%08X)\n",
+ (unsigned int) data_message_period, data_message_period);
res = 0;
}
if ((app_count < US_APP_COUNT_MIN) ||
(app_count > US_APP_COUNT_MAX))
{
- LOGE("wrong user space app count %lu (0x%08X)\n", app_count, app_count);
+ LOGE("wrong user space app count %u (0x%08X)\n",
+ (unsigned int)app_count, app_count);
res = 0;
}
if ((func_count < US_APP_INST_FUNC_MIN) ||
(func_count > US_APP_INST_FUNC_MAX))
{
- LOGE("wrong US app inst func count %lu (0x%08X)\n",
- func_count, func_count);
+ LOGE("wrong US app inst func count %u (0x%08X)\n",
+ (unsigned int)func_count, func_count);
res = 0;
}
if ((lib_count < US_APP_INST_LIB_MIN) ||
(lib_count > US_APP_INST_LIB_MAX))
{
- LOGE("wrong US app inst lib count %lu (0x%08X)\n",
- lib_count, lib_count);
+ LOGE("wrong US app inst lib count %u (0x%08X)\n",
+ (unsigned int)lib_count, lib_count);
res = 0;
}
int check_us_inst_func_args(char *args);
int check_lib_inst_count(uint32_t lib_count);
int check_conf(struct conf_t *conf);
+int check_us_inst_func_ret_type(char ret_type);
// TODO maybe need move to other file
+int prepare_profiling();
int start_profiling();
void stop_profiling();
int reconfigure();
{
char adj_filename[PATH_MAX];
sprintf(adj_filename, "%s.exe", filename);
- char *use_filename = exist(adj_filename) ? adj_filename : filename;
+ const char *use_filename = exist(adj_filename) ? adj_filename
+ : filename;
strcpy(buf, use_filename);
}
#include "sys_stat.h"
#include "buffer.h"
#include "debug.h"
+#include "utils.h"
#define SINGLETON_LOCKFILE "/tmp/da_manager.lock"
#define PORTFILE "/tmp/port.da"
static void get_disk_stat(uint32_t *reads, uint32_t *sec_reads,
uint32_t *writes, uint32_t *sec_writes)
{
- int sec_size = 0;
enum { partition_name_maxlength = 128 };
FILE *fp = manager.fd.diskstats;
char master_partition[partition_name_maxlength] = { 0 };
#include <fcntl.h> // for open
#include <grp.h> // for setgroups
#include <sys/smack.h>
+#include <attr/xattr.h>
+
#include "daemon.h"
#include "utils.h"
#include "debug.h"