[STYLE] Parser: doxygen comments 48/24248/3
authorAlexander Aksenov <a.aksenov@samsung.com>
Mon, 7 Jul 2014 10:07:38 +0000 (14:07 +0400)
committerAlexander Aksenov <a.aksenov@samsung.com>
Fri, 11 Jul 2014 10:03:16 +0000 (03:03 -0700)
Change-Id: I3271ac149047e2b398120e21858a118ae7c8ad4b
Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
14 files changed:
parser/cpu_ctrl.c
parser/cpu_ctrl.h
parser/features.c
parser/features.h
parser/msg_buf.c
parser/msg_buf.h
parser/msg_cmd.c
parser/msg_cmd.h
parser/msg_parser.c
parser/msg_parser.h
parser/parser_defs.h
parser/swap_msg_parser.c
parser/us_inst.c
parser/us_inst.h

index d570935..29b665f 100644 (file)
@@ -1,3 +1,32 @@
+/**
+ * parser/cpu_ctrl.c
+ * @author Vasiliy Ulyanov <v.ulyanov@samsung.com>
+ *
+ * @section LICENSE
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * @section COPYRIGHT
+ *
+ * Copyright (C) Samsung Electronics, 2014
+ *
+ * @section DESCRIPTION
+ *
+ * CPU controls implementation.
+ */
+
 #include <linux/cpumask.h>
 #include <linux/cpu.h>
 #include <ksyms/ksyms.h>
@@ -8,6 +37,12 @@ static void (*swap_cpu_maps_update_done)(void);
 static int (*swap_cpu_down)(unsigned int, int);
 static int (*swap_cpu_up)(unsigned int, int);
 
+/**
+ * @brief Disables nonboot CPUs lock.
+ *
+ * @param mask Pointer to CPU mask struct.
+ * @return 0 on success, error code on error.
+ */
 int swap_disable_nonboot_cpus_lock(struct cpumask *mask)
 {
        int boot_cpu, cpu;
@@ -31,6 +66,12 @@ int swap_disable_nonboot_cpus_lock(struct cpumask *mask)
        return ret;
 }
 
+/**
+ * @brief Enables nonboot CPUs unlock.
+ *
+ * @param mask Pointer to CPU mask struct.
+ * @return 0 on success, error code on error.
+ */
 int swap_enable_nonboot_cpus_unlock(struct cpumask *mask)
 {
        int cpu, ret = 0;
@@ -49,6 +90,11 @@ out:
        return ret;
 }
 
+/**
+ * @brief Intializes CPU controls.
+ *
+ * @return 0 on success, error code on error.
+ */
 int init_cpu_deps(void)
 {
        const char *sym = "cpu_maps_update_begin";
index 17ff199..36d3ed1 100644 (file)
@@ -1,3 +1,32 @@
+/**
+ * @file parser/cpu_ctrl.h
+ * @author Vasiliy Ulyanov <v.ulyanov@samsung.com>
+ *
+ * @section LICENSE
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * @section COPYRIGHT
+ *
+ * Copyright (C) Samsung Electronics, 2014
+ *
+ * @section DESCRIPTION
+ *
+ * CPU controls interface.
+ */
+
 #ifndef _CPU_CTRL_H_
 #define _CPU_CTRL_H_
 
index 66cc9aa..4b264e6 100644 (file)
@@ -1,6 +1,8 @@
-/*
- *  SWAP Parser
- *  modules/parser/features.c
+/**
+ * parser/features.c
+ * @author Vyacheslav Cherkashin
+ *
+ * @section LICENSE
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
+ * @section COPYRIGHT
+ *
  * Copyright (C) Samsung Electronics, 2013
  *
- * 2013         Vyacheslav Cherkashin: SWAP Parser implement
+ * @section DESCRIPTION
  *
+ * Features control implementation.
  */
 
 
 #include <sampler/swap_sampler_module.h>
 #include <energy/energy.h>
 
+/**
+ * @enum features_list
+ * List of supported features.
+ */
 enum features_list {
-       syscall_file    = (1 << 10),    /* File operation syscalls tracing */
-       syscall_ipc     = (1 << 11),    /* IPC syscall tracing */
-       syscall_process = (1 << 12),    /* Process syscalls tracing */
-       syscall_signal  = (1 << 13),    /* Signal syscalls tracing */
-       syscall_network = (1 << 14),    /* Network syscalls tracing */
-       syscall_desc    = (1 << 15),    /* Descriptor syscalls tracing */
-       context_switch  = (1 << 16),    /* Context switch tracing */
-       func_sampling   = (1 << 19)     /* Function sampling */
+       syscall_file    = (1 << 10),    /**< File operation syscalls tracing */
+       syscall_ipc     = (1 << 11),    /**< IPC syscall tracing */
+       syscall_process = (1 << 12),    /**< Process syscalls tracing */
+       syscall_signal  = (1 << 13),    /**< Signal syscalls tracing */
+       syscall_network = (1 << 14),    /**< Network syscalls tracing */
+       syscall_desc    = (1 << 15),    /**< Descriptor syscalls tracing */
+       context_switch  = (1 << 16),    /**< Context switch tracing */
+       func_sampling   = (1 << 19)     /**< Function sampling */
 };
 
+/**
+ * @brief Start user-space instrumentation event handling.
+ *
+ * @param conf Pointer to conf_data config.
+ * @return 0.
+ */
 int set_us_inst(struct conf_data *conf)
 {
        set_quiet(QT_OFF);
@@ -52,6 +67,11 @@ int set_us_inst(struct conf_data *conf)
        return 0;
 }
 
+/**
+ * @brief Stop user-space instrumentation event handling.
+ *
+ * @return 0.
+ */
 int unset_us_inst(void)
 {
        set_quiet(QT_ON);
@@ -59,6 +79,12 @@ int unset_us_inst(void)
        return 0;
 }
 
+/**
+ * @brief Set syscall file feature on.
+ *
+ * @param conf Pointer to conf_data config.
+ * @return set_feature results.
+ */
 int set_syscall_file(struct conf_data *conf)
 {
        int ret;
@@ -68,6 +94,11 @@ int set_syscall_file(struct conf_data *conf)
        return ret;
 }
 
+/**
+ * @brief Set syscall file feature off.
+ *
+ * @return unset_feature results.
+ */
 int unset_syscall_file(void)
 {
        int ret;
@@ -77,6 +108,12 @@ int unset_syscall_file(void)
        return ret;
 }
 
+/**
+ * @brief Set syscall ipc feature on.
+ *
+ * @param conf Pointer to conf_data config.
+ * @return set_feature results.
+ */
 int set_syscall_ipc(struct conf_data *conf)
 {
        int ret;
@@ -86,6 +123,11 @@ int set_syscall_ipc(struct conf_data *conf)
        return ret;
 }
 
+/**
+ * @brief Set syscall ipc feature off.
+ *
+ * @return unset_feature results.
+ */
 int unset_syscall_ipc(void)
 {
        int ret;
@@ -95,6 +137,12 @@ int unset_syscall_ipc(void)
        return ret;
 }
 
+/**
+ * @brief Set syscall process feature on.
+ *
+ * @param conf Pointer to conf_data config.
+ * @return set_feature results.
+ */
 int set_syscall_process(struct conf_data *conf)
 {
        int ret;
@@ -104,6 +152,11 @@ int set_syscall_process(struct conf_data *conf)
        return ret;
 }
 
+/**
+ * @brief Set syscall process feature off.
+ *
+ * @return unset_feature results.
+ */
 int unset_syscall_process(void)
 {
        int ret;
@@ -113,6 +166,12 @@ int unset_syscall_process(void)
        return ret;
 }
 
+/**
+ * @brief Set syscall signal feature on.
+ *
+ * @param conf Pointer to conf_data config.
+ * @return set_feature results.
+ */
 int set_syscall_signal(struct conf_data *conf)
 {
        int ret;
@@ -122,6 +181,11 @@ int set_syscall_signal(struct conf_data *conf)
        return ret;
 }
 
+/**
+ * @brief Set syscall signal feature off.
+ *
+ * @return unset_feature results.
+ */
 int unset_syscall_signal(void)
 {
        int ret;
@@ -131,6 +195,12 @@ int unset_syscall_signal(void)
        return ret;
 }
 
+/**
+ * @brief Set syscall network feature on.
+ *
+ * @param conf Pointer to conf_data config.
+ * @return set_feature results.
+ */
 int set_syscall_network(struct conf_data *conf)
 {
        int ret;
@@ -140,6 +210,11 @@ int set_syscall_network(struct conf_data *conf)
        return ret;
 }
 
+/**
+ * @brief Set syscall network feature off.
+ *
+ * @return unset_feature results.
+ */
 int unset_syscall_network(void)
 {
        int ret;
@@ -149,6 +224,12 @@ int unset_syscall_network(void)
        return ret;
 }
 
+/**
+ * @brief Set syscall desc feature on.
+ *
+ * @param conf Pointer to conf_data config.
+ * @return set_feature results.
+ */
 int set_syscall_desc(struct conf_data *conf)
 {
        int ret;
@@ -158,6 +239,11 @@ int set_syscall_desc(struct conf_data *conf)
        return ret;
 }
 
+/**
+ * @brief Set syscall desc feature off.
+ *
+ * @return unset_feature results.
+ */
 int unset_syscall_desc(void)
 {
        int ret;
@@ -167,6 +253,12 @@ int unset_syscall_desc(void)
        return ret;
 }
 
+/**
+ * @brief Set context switch feature on.
+ *
+ * @param conf Pointer to conf_data config.
+ * @return set_feature results.
+ */
 int set_context_switch(struct conf_data *conf)
 {
        int ret;
@@ -175,7 +267,11 @@ int set_context_switch(struct conf_data *conf)
 
        return ret;
 }
-
+/**
+ * @brief Set context switch feature off.
+ *
+ * @return unset_feature results.
+ */
 int unset_context_switch(void)
 {
        int ret;
@@ -185,6 +281,12 @@ int unset_context_switch(void)
        return ret;
 }
 
+/**
+ * @brief Set sampling feature on.
+ *
+ * @param conf Pointer to conf_data config.
+ * @return set_feature results.
+ */
 int set_func_sampling(struct conf_data *conf)
 {
        int ret;
@@ -194,6 +296,11 @@ int set_func_sampling(struct conf_data *conf)
        return ret;
 }
 
+/**
+ * @brief Set sampling feature off.
+ *
+ * @return unset_feature results.
+ */
 int unset_func_sampling(void)
 {
        int ret;
@@ -213,6 +320,16 @@ static int unset_func_energy(void)
        return unset_energy();
 }
 
+/**
+ * @struct feature_item
+ * @brief Struct that describes feature.
+ * @var feature_item::name
+ * Feature name.
+ * @var feature_item::set
+ * Set feature callback.
+ * @var feature_item::unset
+ * Unset feature callback.
+ */
 struct feature_item {
        char *name;
        int (*set)(struct conf_data *conf);
@@ -309,6 +426,9 @@ static struct feature_item *feature_list[] = {
  /* 26 */      &feature_func_energy
 };
 
+/**
+ * @brief SIZE_FEATURE_LIST definition.
+ */
 enum {
        SIZE_FEATURE_LIST = sizeof(feature_list) / sizeof(struct feature_item *),
 };
@@ -316,6 +436,11 @@ enum {
 static u64 feature_inst = 0;
 static u64 feature_mask = 0;
 
+/**
+ * @brief Inits features list.
+ *
+ * @return 0.
+ */
 int init_features(void)
 {
        int i;
@@ -330,6 +455,11 @@ int init_features(void)
        return 0;
 }
 
+/**
+ * @brief Uninits features list.
+ *
+ * @return Void.
+ */
 void uninit_features(void)
 {
 }
@@ -375,6 +505,12 @@ static int do_set_features(struct conf_data *conf)
 
 static DEFINE_MUTEX(mutex_features);
 
+/**
+ * @brief Wrapper for do_set_features with locking.
+ *
+ * @param conf Pointer to the current config.
+ * @return do_set_features result.
+ */
 int set_features(struct conf_data *conf)
 {
        int ret;
index b3a9dd6..765bc78 100644 (file)
@@ -1,6 +1,8 @@
-/*
- *  SWAP Parser
- *  modules/parser/features.h
+/**
+ * @file parser/features.h
+ * @author Vyacheslav Cherkashin
+ *
+ * @section LICENSE
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
+ * @section COPYRIGHT
+ *
  * Copyright (C) Samsung Electronics, 2013
  *
- * 2013         Vyacheslav Cherkashin: SWAP Parser implement
+ * @section DESCRIPTION
  *
+ * Features control interface declaration.
  */
 
 
index 3520874..92cc86e 100644 (file)
@@ -1,6 +1,9 @@
-/*
- *  SWAP Parser
- *  modules/parser/msg_buf.c
+/**
+ * parser/msg_buf.c
+ * @author Vyacheslav Cherkashin
+ * @author Vitaliy Cherepanov
+ *
+ * @section LICENSE
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
+ * @section COPYRIGHT
+ *
  * Copyright (C) Samsung Electronics, 2013
  *
- * 2013         Vyacheslav Cherkashin, Vitaliy Cherepanov: SWAP Parser implement
+ * @section DESCRIPTION
  *
+ * Message buffer controls implementation.
  */
 
 
 #include "msg_buf.h"
 #include "parser_defs.h"
 
+/**
+ * @brief Initializes message buffer.
+ *
+ * @param mb Pointer to message buffer struct.
+ * @param size Size of the message buffer.
+ * @return 0 on success, negative error code on error.
+ */
 int init_mb(struct msg_buf *mb, size_t size)
 {
        if (size) {
@@ -45,11 +58,26 @@ int init_mb(struct msg_buf *mb, size_t size)
        return 0;
 }
 
+/**
+ * @brief Uninitializes message buffer.
+ *
+ * @param mb Pointer to message buffer struct.
+ * @return Void.
+ */
 void uninit_mb(struct msg_buf *mb)
 {
        vfree(mb->begin);
 }
 
+/**
+ * @brief Checks if current buffer data pointer is at the end.
+ *
+ * @param mb Pointer to the message buffer struct.
+ * @param size Size of the message buffer.
+ * @return 1 - buffer ptr is not at the end,
+ * 0 - buffer ptr is at the end,
+ * -1 - buffer ptr is invalid (far away of the end).
+ */
 int cmp_mb(struct msg_buf *mb, size_t size)
 {
        char *tmp;
@@ -63,16 +91,36 @@ int cmp_mb(struct msg_buf *mb, size_t size)
        return 0;
 }
 
+/**
+ * @brief Gets remainder part of message buffer.
+ *
+ * @param mb Pointer to the message buffer struct.
+ * @return Remainder part of message buffer.
+ */
 size_t remained_mb(struct msg_buf *mb)
 {
        return mb->end - mb->ptr;
 }
 
+/**
+ * @brief Checks whether we reached the end of the message buffer or not.
+ *
+ * @param mb Pointer to the message buffer struct.
+ * @return 1 - if message buffer end has been reached \n
+ * 0 - otherwise.
+ */
 int is_end_mb(struct msg_buf *mb)
 {
        return mb->ptr == mb->end;
 }
 
+/**
+ * @brief Reads 8 bits from message buffer and updates buffer's pointer.
+ *
+ * @param mb Pointer to the message buffer struct.
+ * @param val Pointer to the target variable where to put read value.
+ * @return 0 on success, negative error code on error.
+ */
 int get_u8(struct msg_buf *mb, u8 *val)
 {
        if (cmp_mb(mb, sizeof(*val)) < 0)
@@ -86,6 +134,13 @@ int get_u8(struct msg_buf *mb, u8 *val)
        return 0;
 }
 
+/**
+ * @brief Reads 32 bits from message buffer and updates buffer's pointer.
+ *
+ * @param mb Pointer to the message buffer struct.
+ * @param val Pointer to the target variable where to put read value.
+ * @return 0 on success, negative error code on error.
+ */
 int get_u32(struct msg_buf *mb, u32 *val)
 {
        if (cmp_mb(mb, sizeof(*val)) < 0)
@@ -99,6 +154,13 @@ int get_u32(struct msg_buf *mb, u32 *val)
        return 0;
 }
 
+/**
+ * @brief Reads 64 bits from message buffer and updates buffer's pointer.
+ *
+ * @param mb Pointer to the message buffer struct.
+ * @param val Pointer to the target variable where to put read value.
+ * @return 0 on success, negative error code on error.
+ */
 int get_u64(struct msg_buf *mb, u64 *val)
 {
        if (cmp_mb(mb, sizeof(*val)) < 0)
@@ -111,6 +173,14 @@ int get_u64(struct msg_buf *mb, u64 *val)
        return 0;
 }
 
+/**
+ * @brief Reads null-terminated string from message buffer and updates
+ * buffer's pointer.
+ *
+ * @param mb Pointer to the message buffer struct.
+ * @param str Pointer to the target variable where to put read string.
+ * @return 0 on success, negative error code on error.
+ */
 int get_string(struct msg_buf *mb, char **str)
 {
        size_t len, len_max;
@@ -135,6 +205,12 @@ int get_string(struct msg_buf *mb, char **str)
        return 0;
 }
 
+/**
+ * @brief Releases string memory allocated in get_string.
+ *
+ * @param str Pointer to the target string.
+ * @return Void.
+ */
 void put_string(char *str)
 {
        kfree(str);
index 968f17d..7095093 100644 (file)
@@ -1,6 +1,8 @@
-/*
- *  SWAP Parser
- *  modules/parser/msg_buf.c
+/**
+ * @file parser/msg_buf.h
+ * @author Vyacheslav Cherkashin
+ *
+ * @section LICENSE
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
+ * @section COPYRIGHT
+ *
  * Copyright (C) Samsung Electronics, 2013
  *
- * 2013         Vyacheslav Cherkashin: SWAP Parser implement
+ * @section DESCRIPTION
  *
+ * Message buffer interface declaration.
  */
 
 
 
 #include <linux/types.h>
 
+/**
+ * @struct msg_buf
+ * @brief Stores pointers to the message buffer.
+ */
 struct msg_buf {
-       char *begin;
-       char *end;
-       char *ptr;
+       char *begin;    /**< Pointer to the beginning of the buffer. */
+       char *end;      /**< Pointer to the end of the buffer. */
+       char *ptr;      /**< Buffer iterator. */
 };
 
 int init_mb(struct msg_buf *mb, size_t size);
index 04825a5..b516a21 100644 (file)
@@ -1,6 +1,8 @@
-/*
- *  SWAP Parser
- *  modules/parser/msg_cmd.c
+/**
+ * parser/msg_cmd.c
+ * @author Vyacheslav Cherkashin
+ *
+ * @section LICENSE
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
+ * @section COPYRIGHT
+ *
  * Copyright (C) Samsung Electronics, 2013
  *
- * 2013         Vyacheslav Cherkashin: SWAP Parser implement
+ * @section DESCRIPTION
  *
+ * Module's messages parsing implementation.
  */
 
 
@@ -41,6 +46,12 @@ static int set_config(struct conf_data *conf)
        return ret;
 }
 
+/**
+ * @brief Message "keep alive" handling.
+ *
+ * @param mb Pointer to the message buffer.
+ * @return 0 on success, negative error code on error.
+ */
 int msg_keep_alive(struct msg_buf *mb)
 {
        if (!is_end_mb(mb)) {
@@ -51,6 +62,12 @@ int msg_keep_alive(struct msg_buf *mb)
        return 0;
 }
 
+/**
+ * @brief Message "start" handling.
+ *
+ * @param mb Pointer to the message buffer.
+ * @return 0 on success, negative error code on error.
+ */
 int msg_start(struct msg_buf *mb)
 {
        int ret = 0;
@@ -91,6 +108,12 @@ free_us_inst:
        return ret;
 }
 
+/**
+ * @brief Message "stop" handling.
+ *
+ * @param mb Pointer to the message buffer.
+ * @return 0 on success, negative error code on error.
+ */
 int msg_stop(struct msg_buf *mb)
 {
        int ret = 0;
@@ -119,6 +142,12 @@ int msg_stop(struct msg_buf *mb)
        return ret;
 }
 
+/**
+ * @brief Message "config" handling.
+ *
+ * @param mb Pointer to the message buffer.
+ * @return 0 on success, negative error code on error.
+ */
 int msg_config(struct msg_buf *mb)
 {
        int ret = 0;
@@ -148,6 +177,12 @@ free_conf_data:
        return ret;
 }
 
+/**
+ * @brief Message "swap inst add" handling.
+ *
+ * @param mb Pointer to the message buffer.
+ * @return 0 on success, negative error code on error.
+ */
 int msg_swap_inst_add(struct msg_buf *mb)
 {
        int ret = 0;
@@ -172,6 +207,12 @@ free_us_inst:
        return ret;
 }
 
+/**
+ * @brief Message "swap inst remove" handling.
+ *
+ * @param mb Pointer to the message buffer.
+ * @return 0 on success, negative error code on error.
+ */
 int msg_swap_inst_remove(struct msg_buf *mb)
 {
        int ret = 0;
@@ -196,6 +237,11 @@ free_us_inst:
        return ret;
 }
 
+/**
+ * @brief Initializes commands handling.
+ *
+ * @return Initialization results.
+ */
 int init_cmd(void)
 {
        int ret;
@@ -205,6 +251,11 @@ int init_cmd(void)
        return ret;
 }
 
+/**
+ * @brief Uninitializes commands handling.
+ *
+ * @return Void.
+ */
 void uninit_cmd(void)
 {
        uninit_features();
index 9f0342b..16132ca 100644 (file)
@@ -1,6 +1,8 @@
-/*
- *  SWAP Parser
- *  modules/parser/msg_cmd.c
+/**
+ * @file parser/msg_cmd.h
+ * @author Vyacheslav Cherkashin
+ *
+ * @section LICENSE
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
+ * @section COPYRIGHT
+ *
  * Copyright (C) Samsung Electronics, 2013
  *
- * 2013         Vyacheslav Cherkashin: SWAP Parser implement
+ * @section DESCRIPTION
  *
+ * Module's message handling interface declaration.
  */
 
 #ifndef _MSG_CMD_H
index 394aae2..8ca60af 100644 (file)
@@ -1,6 +1,9 @@
-/*
- *  SWAP Parser
- *  modules/parser/msg_parser.c
+/**
+ * parser/msg_parser.c
+ * @author Vyacheslav Cherkashin
+ * @author Vitaliy Cherepanov
+ *
+ * @sectionLICENSE
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
+ * @section COPYRIGHT
+ *
  * Copyright (C) Samsung Electronics, 2013
  *
- * 2013         Vyacheslav Cherkashin, Vitaliy Cherepanov: SWAP Parser implement
+ * @section DESCRIPTION
  *
+ * Message parsing implementation.
  */
 
 
@@ -55,6 +61,14 @@ static int str_to_u32(const char* str, u32 *val)
  * ==                               APP_INFO                                 ==
  * ============================================================================
  */
+
+/**
+ * @brief Creates and fills app_info_data struct.
+ *
+ * @param mb Pointer to the message buffer.
+ * @return Pointer to the filled app_info_data struct on success;\n
+ * NULL on error.
+ */
 struct app_info_data *create_app_info(struct msg_buf *mb)
 {
        int ret;
@@ -137,6 +151,12 @@ free_ta_id:
        return NULL;
 }
 
+/**
+ * @brief app_info_data cleanup.
+ *
+ * @param ai Pointer to the target app_info_data.
+ * @return Void.
+ */
 void destroy_app_info(struct app_info_data *ai)
 {
        put_string(ai->exec_path);
@@ -151,6 +171,14 @@ void destroy_app_info(struct app_info_data *ai)
  * ==                                CONFIG                                  ==
  * ============================================================================
  */
+
+/**
+ * @brief Creates and fills conf_data struct.
+ *
+ * @param mb Pointer to the message buffer.
+ * @return Pointer to the filled conf_data struct on success;\n
+ * 0 on error.
+ */
 struct conf_data *create_conf_data(struct msg_buf *mb)
 {
        struct conf_data *conf;
@@ -196,17 +224,36 @@ struct conf_data *create_conf_data(struct msg_buf *mb)
        return conf;
 }
 
+/**
+ * @brief conf_data cleanup.
+ *
+ * @param conf Pointer to the target conf_data.
+ * @return Void.
+ */
 void destroy_conf_data(struct conf_data *conf)
 {
        kfree(conf);
 }
 
 static struct conf_data config;
+
+/**
+ * @brief Saves config to static config variable.
+ *
+ * @param conf Variable to save.
+ * @return Void.
+ */
 void save_config(const struct conf_data *conf)
 {
        memcpy(&config, conf, sizeof(config));
 }
 
+/**
+ * @brief Restores config from static config variable.
+ *
+ * @param conf Variable to restore.
+ * @return Void.
+ */
 void restore_config(struct conf_data *conf)
 {
        memcpy(conf, &config, sizeof(*conf));
@@ -218,6 +265,14 @@ void restore_config(struct conf_data *conf)
  * ==                               FUNC_INST                                ==
  * ============================================================================
  */
+
+/**
+ * @brief Creates and fills func_inst_data struct.
+ *
+ * @param mb Pointer to the message buffer.
+ * @return Pointer to the filled func_inst_data struct on success;\n
+ * 0 on error.
+ */
 struct func_inst_data *create_func_inst_data(struct msg_buf *mb)
 {
        struct func_inst_data *fi;
@@ -260,6 +315,12 @@ free_args:
        return NULL;
 }
 
+/**
+ * @brief func_inst_data cleanup.
+ *
+ * @param fi Pointer to the target func_inst_data.
+ * @return Void.
+ */
 void destroy_func_inst_data(struct func_inst_data *fi)
 {
        put_string(fi->args);
@@ -274,6 +335,14 @@ void destroy_func_inst_data(struct func_inst_data *fi)
  * ==                               LIB_INST                                 ==
  * ============================================================================
  */
+
+/**
+ * @brief Creates and fills lib_inst_data struct.
+ *
+ * @param mb Pointer to the message buffer.
+ * @return Pointer to the filled lib_inst_data struct on success;\n
+ * 0 on error.
+ */
 struct lib_inst_data *create_lib_inst_data(struct msg_buf *mb)
 {
        struct lib_inst_data *li;
@@ -340,6 +409,12 @@ free_path:
        return NULL;
 }
 
+/**
+ * @brief lib_inst_data cleanup.
+ *
+ * @param li Pointer to the target lib_inst_data.
+ * @return Void.
+ */
 void destroy_lib_inst_data(struct lib_inst_data *li)
 {
        int i;
@@ -361,6 +436,14 @@ void destroy_lib_inst_data(struct lib_inst_data *li)
  * ==                               APP_INST                                 ==
  * ============================================================================
  */
+
+/**
+ * @brief Creates and fills app_inst_data struct.
+ *
+ * @param mb Pointer to the message buffer.
+ * @return Pointer to the filled app_inst_data struct on success;\n
+ * 0 on error.
+ */
 struct app_inst_data *create_app_inst_data(struct msg_buf *mb)
 {
        struct app_inst_data *app_inst;
@@ -458,6 +541,12 @@ free_app_info:
        return NULL;
 }
 
+/**
+ * @brief app_inst_data cleanup.
+ *
+ * @param ai Pointer to the target app_inst_data.
+ * @return Void.
+ */
 void destroy_app_inst_data(struct app_inst_data *ai)
 {
        int i;
@@ -482,6 +571,14 @@ void destroy_app_inst_data(struct app_inst_data *ai)
  * ==                                US_INST                                 ==
  * ============================================================================
  */
+
+/**
+ * @brief Creates and fills us_inst_data struct.
+ *
+ * @param mb Pointer to the message buffer.
+ * @return Pointer to the filled us_inst_data struct on success;\n
+ * 0 on error.
+ */
 struct us_inst_data *create_us_inst_data(struct msg_buf *mb)
 {
        struct us_inst_data *ui;
@@ -538,6 +635,12 @@ free_ui:
        return NULL;
 }
 
+/**
+ * @brief us_inst_data cleanup.
+ *
+ * @param ui Pointer to the target us_inst_data.
+ * @return Void.
+ */
 void destroy_us_inst_data(struct us_inst_data *ui)
 {
        int i;
index 55751ac..a097d71 100644 (file)
@@ -1,6 +1,9 @@
-/*
- *  SWAP Parser
- *  modules/parser/msg_parser.h
+/**
+ * @file parser/msg_parser.h
+ * @author Vyacheslav Cherkashin
+ * @author Vitaliy Cherepanov
+ *
+ * @section LICENSE
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
+ * @section COPYRIGHT
+ *
  * Copyright (C) Samsung Electronics, 2013
  *
- * 2013         Vyacheslav Cherkashin, Vitaliy Cherepanov: SWAP Parser implement
+ * @section DESCRIPTION
  *
+ * Message parsing interface declaration.
  */
 
 
 
 struct msg_buf;
 
+/**
+ * @enum APP_TYPE
+ * Supported application types.
+ */
 enum APP_TYPE {
-       AT_TIZEN_NATIVE_APP     = 0x01,
-       AT_PID                  = 0x02,
-       AT_COMMON_EXEC          = 0x03,
-       AT_TIZEN_WEB_APP        = 0x04
+       AT_TIZEN_NATIVE_APP     = 0x01,     /**< Tizen native application. */
+       AT_PID                  = 0x02,         /**< App with specified PID. */
+       AT_COMMON_EXEC          = 0x03,     /**< Common application. */
+       AT_TIZEN_WEB_APP        = 0x04      /**< Tizen web application. */
 };
 
+/**
+ * @brief App type size defenition.
+ */
 enum {
        SIZE_APP_TYPE = 4
 };
 
-/* Basic application information */
+/**
+ * @struct app_info_data
+ * @brief Basic application information.
+ */
 struct app_info_data {
-       enum APP_TYPE app_type;
-       pid_t tgid;
-       char *exec_path;
+       enum APP_TYPE app_type;     /**< Application type. */
+       pid_t tgid;                 /**< Application PID. */
+       char *exec_path;            /**< Application execution path. */
 };
 
-/* Configuration struct */
+/**
+ * @struct conf_data
+ * @brief Configuration struct.
+ */
 struct conf_data {
-       u64 use_features0;
-       u64 use_features1;
-       u32 sys_trace_period;
-       u32 data_msg_period;
+       u64 use_features0;          /**< Feature flags. */
+       u64 use_features1;          /**< Feature flags. */
+       u32 sys_trace_period;       /**< Trace period. */
+       u32 data_msg_period;        /**< Data message period. */
 };
 
-/* Application and library functions to set probes */
+/**
+ * @struct func_inst_data
+ * @brief Application and library functions to set probes.
+ */
 struct func_inst_data {
-       u64 addr;
-       char *args;
-       char ret_type;
+       u64 addr;                   /**< Function address. */
+       char *args;                 /**< Function args format string. */
+       char ret_type;              /**< Function return type. */
 };
 
-/* Library struct */
+/**
+ * @struct lib_inst_data
+ * @brief Library struct.
+ */
 struct lib_inst_data {
-       char *path;
-       u32 cnt_func;
-       struct func_inst_data **func;
+       char *path;                 /**< Library path. */
+       u32 cnt_func;               /**< Function probes count in this library. */
+       struct func_inst_data **func;    /**< Pointer to the probes array. */
 };
 
-/* Application struct */
+/**
+ * @struct app_inst_data
+ * @brief Application struct.
+ */
 struct app_inst_data {
-       struct app_info_data *app_info;
-       u32 cnt_func;
-       struct func_inst_data **func;
-       u32 cnt_lib;
-       struct lib_inst_data **lib;
+       struct app_info_data *app_info;     /**< Pointer to app_info struct. */
+       u32 cnt_func;                       /**< Function probes count in app. */
+       struct func_inst_data **func;       /**< Pointer to the probes array. */
+       u32 cnt_lib;                        /**< Libs count. */
+       struct lib_inst_data **lib;         /**< Pointer to the libs array. */
 };
 
-/* User space instrumentation struct */
+/**
+ * @struct us_inst_data
+ * @brief User space instrumentation struct.
+ */
 struct us_inst_data {
-       u32 cnt;
-       struct app_inst_data **app_inst;
+       u32 cnt;                            /**< Apps count. */
+       struct app_inst_data **app_inst;    /**< Pointer to the apps array. */
 };
 
 
@@ -114,6 +145,9 @@ struct lib_inst_data make_lib_inst_data(void);
 struct app_inst_data make_app_inst_data(void);
 struct us_inst_data make_us_inst_data(void);
 
+/**
+ * @brief Constant defenitions.
+ */
 enum {
        MIN_SIZE_STRING = 1,
        MIN_SIZE_FUNC_INST = sizeof(make_func_inst_data().addr) +
index 063bb03..7807c4e 100644 (file)
@@ -1,6 +1,9 @@
-/*
- *  SWAP Parser
- *  modules/parser/parser_defs.h
+/**
+ * @file modules/parser/parser_defs.h
+ * @author Alexander Aksenov <a.aksenov@samsung.com>
+ * @author Vitaliy Cherepanov:
+ *
+ * @section LICENSE
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
+ * @section COPYRIGHT
+ *
  * Copyright (C) Samsung Electronics, 2013
  *
- * 2013         Alexander Aksenov <a.aksenov@samsung.com>, Vitaliy Cherepanov:
- *          SWAP Parser implement
+ * @section DESCRIPTION
  *
+ * Parser defenitions.
  */
 
 
 
 /* #define PARSE_DEBUG */
 
+/** Prints debug message. */
 #define print_debug(msg, args...) \
     printk(KERN_DEBUG "SWAP_PARSER DEBUG : " msg, ##args)
+/** Prints info message. */
 #define print_msg(msg, args...)   \
     printk(KERN_INFO "SWAP_PARSER : " msg, ##args)
+/** Prints warning message. */
 #define print_warn(msg, args...)  \
     printk(KERN_WARNING "SWAP_PARSER WARNING : " msg, ##args)
+/** Prints error message. */
 #define print_err(msg, args...)   \
     printk(KERN_ERR "SWAP_PARSER ERROR : " msg, ##args)
+/** Prints critical error message. */
 #define print_crit(msg, args...)  \
     printk(KERN_CRIT "SWAP_PARSER CRITICAL : " msg, ##args)
 
index 5c32fc1..f1071e2 100644 (file)
@@ -1,6 +1,9 @@
-/*
- *  SWAP Parser
- *  modules/parser/swap_msg_parser.c
+/**
+ * parser/swap_msg_parser.c
+ * @author Vyacheslav Cherkashin
+ * @author Vitaliy Cherepanov
+ *
+ * @section LICENSE
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
+ * @section COPYRIGHT
+ *
  * Copyright (C) Samsung Electronics, 2013
  *
- * 2013         Vyacheslav Cherkashin, Vitaliy Cherepanov: SWAP Parser implement
+ * @section DESCRIPTION
  *
+ * Parser module interface implementation.
  */
 
 
 #include <driver/driver_to_msg.h>
 #include <driver/swap_ioctl.h>
 
+/**
+ * @enum MSG_ID
+ * @brief Message IDs.
+ */
 enum MSG_ID {
-       MSG_KEEP_ALIVE          = 0x0001,
-       MSG_START               = 0x0002,
-       MSG_STOP                = 0x0003,
-       MSG_CONFIG              = 0x0004,
-       MSG_SWAP_INST_ADD       = 0x0008,
-       MSG_SWAP_INST_REMOVE    = 0x0009
+       MSG_KEEP_ALIVE          = 0x0001,       /**< Keep alive message. */
+       MSG_START               = 0x0002,           /**< Start message. */
+       MSG_STOP                = 0x0003,           /**< Stop message. */
+       MSG_CONFIG              = 0x0004,           /**< Config message. */
+       MSG_SWAP_INST_ADD       = 0x0008,       /**< Swap inst add message. */
+       MSG_SWAP_INST_REMOVE    = 0x0009    /**< Swap inst remove message. */
 };
 
+/**
+ * @struct basic_msg_fmt
+ * @brief Basic part of each message.
+ */
 struct basic_msg_fmt {
-       u32 msg_id;
-       u32 len;
+       u32 msg_id;                         /**< Message ID. */
+       u32 len;                            /**< Message length. */
 } __attribute__((packed));
 
 static int msg_handler(void __user *msg)
index d6d8b30..108712d 100644 (file)
@@ -1,6 +1,8 @@
-/*
- *  SWAP Parser
- *  modules/parser/us_inst.c
+/**
+ * parser/us_inst.c
+ * @author Vyacheslav Cherkashin
+ *
+ * @section LICENSE
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
+ * @section COPYRIGHT
+ *
  * Copyright (C) Samsung Electronics, 2013
  *
- * 2013         Vyacheslav Cherkashin: SWAP Parser implement
+ * @section DESCRIPTION
  *
+ * User-space instrumentation controls.
  */
 
 
@@ -175,6 +180,13 @@ static int mod_us_app_inst(struct app_inst_data *app_inst, enum MOD_TYPE mt)
        return 0;
 }
 
+/**
+ * @brief Registers probes.
+ *
+ * @param us_inst Pointer to the target us_inst_data struct.
+ * @param mt Modificator, indicates whether we install or remove probes.
+ * @return 0 on suceess, error code on error.
+ */
 int mod_us_inst(struct us_inst_data *us_inst, enum MOD_TYPE mt)
 {
        u32 i;
index 76abcde..9b430bc 100644 (file)
@@ -1,6 +1,8 @@
-/*
- *  SWAP Parser
- *  modules/parser/us_inst.h
+/**
+ * @file parser/us_inst.h
+ * @author Vyacheslav Cherkashin
+ *
+ * @section LICENSE
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
+ * @section COPYRIGHT
+ *
  * Copyright (C) Samsung Electronics, 2013
  *
- * 2013         Vyacheslav Cherkashin: SWAP Parser implement
+ * @section DESCRIPTION
  *
+ * User-space instrumentation controls interface.
  */
 
 
 #ifndef _US_INST_H
 #define _US_INST_H
 
+/**
+ * @enum MOD_TYPE
+ * @brief Type of mod_us_inst behaviour. */
 enum MOD_TYPE {
-       MT_ADD,
-       MT_DEL
+       MT_ADD,             /**< Add probes. */
+       MT_DEL              /**< Remove probes. */
 };
 
 struct us_inst_data;