[STYLE] Sampler: doxygen comments 49/24249/3
authorAlexander Aksenov <a.aksenov@samsung.com>
Mon, 7 Jul 2014 10:33:40 +0000 (14:33 +0400)
committerAlexander Aksenov <a.aksenov@samsung.com>
Fri, 11 Jul 2014 10:03:20 +0000 (03:03 -0700)
Change-Id: I9463827b6cc73fe05d6d860bf32bba19cea3ede3
Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
sampler/kernel_operations.h
sampler/sampler_hrtimer.c
sampler/sampler_timer.c
sampler/swap_sampler_errors.h
sampler/swap_sampler_module.c
sampler/swap_sampler_module.h

index 859e893..04d8fa9 100644 (file)
@@ -1,6 +1,8 @@
-/*
- *  SWAP sampler
- *  modules/sampler/kernel_operations.h
+/**
+ * @file sampler/kernel_operations.h
+ * @author Alexander Aksenov <a.aksenov@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
  * 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>: SWAP samler kernel
- *                                                  operations implement
+ * @section DESCRIPTION
  *
+ * Parser definitions.
  */
 
 #ifndef __KERNEL_OPERATIONS_H__
 
 #include <linux/kernel.h>
 
+/** Prints debug message.*/
 #define print_debug(msg, args...) \
        printk(KERN_DEBUG "SWAP_SAMPLER DEBUG : " msg, ##args)
+/** Prints info message.*/
 #define print_msg(msg, args...)   \
        printk(KERN_INFO "SWAP_SAMPLER : " msg, ##args)
+/** Prints warning message.*/
 #define print_warn(msg, args...)  \
        printk(KERN_WARNING "SWAP_SAMPLER WARNING : " msg, ##args)
+/** Prints error message.*/
 #define print_err(msg, args...)   \
        printk(KERN_ERR "SWAP_SAMPLER ERROR : " msg, ##args)
+/** Prints critical error message.*/
 #define print_crit(msg, args...)  \
        printk(KERN_CRIT "SWAP_SAMPLER CRITICAL : " msg, ##args)
 
index 31b6987..e7a1b45 100644 (file)
@@ -1,6 +1,8 @@
-/*
- *  SWAP sampler
- *  modules/sampler/sampler_hrtimer.c
+/**
+ * sampler/sampler_hrtimer.c
+ * @author Alexander Aksenov <a.aksenov@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
  * 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>: SWAP sampler porting
+ * @section DESCRIPTION
  *
+ * Sampler for high resolution timers.
  */
 
 
@@ -32,6 +37,12 @@ static u64 sampler_timer_quantum = 0;
 static DEFINE_PER_CPU(struct hrtimer, swap_hrtimer);
 static int swap_hrtimer_running;
 
+/**
+ * @brief Restarts sampling.
+ *
+ * @param timer Pointer to hrtimer struct.
+ * @return hrtimer_restart flag.
+ */
 restart_ret sampler_timers_restart(swap_timer *timer)
 {
        restart_ret ret;
@@ -42,19 +53,32 @@ restart_ret sampler_timers_restart(swap_timer *timer)
        return ret;
 }
 
-
+/**
+ * @brief Sets running flag true.
+ *
+ * @return Void.
+ */
 void sampler_timers_set_run(void)
 {
        swap_hrtimer_running = 1;
 }
 
-
+/**
+ * @brief Sets running flag false.
+ *
+ * @return Void.
+ */
 void sampler_timers_set_stop(void)
 {
        swap_hrtimer_running = 0;
 }
 
-
+/**
+ * @brief Starts timer sampling.
+ *
+ * @param restart_func Pointer to restart function.
+ * @return Void.
+ */
 void sampler_timers_start(void *restart_func)
 {
        struct hrtimer *hrtimer = &__get_cpu_var(swap_hrtimer);
@@ -68,7 +92,12 @@ void sampler_timers_start(void *restart_func)
                  HRTIMER_MODE_REL_PINNED);
 }
 
-
+/**
+ * @brief Stops timer sampling.
+ *
+ * @param cpu Online CPUs.
+ * @return Void.
+ */
 void sampler_timers_stop(int cpu)
 {
        struct hrtimer *hrtimer = &per_cpu(swap_hrtimer, cpu);
@@ -79,7 +108,12 @@ void sampler_timers_stop(int cpu)
        hrtimer_cancel(hrtimer);
 }
 
-
+/**
+ * @brief Sets timer quantum.
+ *
+ * @param timer_quantum Timer quantum.
+ * @return Void.
+ */
 void sampler_timers_set_quantum(unsigned int timer_quantum)
 {
        sampler_timer_quantum = timer_quantum * 1000 * 1000;
index 025cedb..754d3f1 100644 (file)
@@ -1,6 +1,8 @@
-/*
- *  SWAP sampler
- *  modules/sampler/sampler_timer.c
+/**
+ * sampler/sampler_timer.c
+ * @author Alexander Aksenov <a.aksenov@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
  * 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>: SWAP sampler porting
+ * @section DESCRIPTION
  *
+ * Sampler based on common timers.
  */
 
 
@@ -32,7 +37,12 @@ static unsigned long sampler_timer_quantum = 0;
 static DEFINE_PER_CPU(struct timer_list, swap_timer);
 static int swap_timer_running;
 
-
+/**
+ * @brief Restarts sampling.
+ *
+ * @param timer Pointer to timer_list struct.
+ * @return 0.
+ */
 restart_ret sampler_timers_restart(swap_timer *timer)
 {
        restart_ret ret;
@@ -44,19 +54,32 @@ restart_ret sampler_timers_restart(swap_timer *timer)
        return ret;
 }
 
-
+/**
+ * @brief Sets running flag true.
+ *
+ * @return Void.
+ */
 void sampler_timers_set_run(void)
 {
        swap_timer_running = 1;
 }
 
-
+/**
+ * @brief Sets running flag false.
+ *
+ * @return Void.
+ */
 void sampler_timers_set_stop(void)
 {
        swap_timer_running = 0;
 }
 
-
+/**
+ * @brief Starts timer sampling.
+ *
+ * @param restart_func Pointer to restart function.
+ * @return Void.
+ */
 void sampler_timers_start(void *restart_func)
 {
        struct timer_list *timer = &__get_cpu_var(swap_timer);
@@ -71,7 +94,12 @@ void sampler_timers_start(void *restart_func)
        mod_timer_pinned(timer, jiffies + sampler_timer_quantum);
 }
 
-
+/**
+ * @brief Stops timer sampling.
+ *
+ * @param cpu Online CPUs.
+ * @return Void.
+ */
 void sampler_timers_stop(int cpu)
 {
        struct timer_list *timer = &per_cpu(swap_timer, cpu);
@@ -81,7 +109,12 @@ void sampler_timers_stop(int cpu)
        del_timer_sync(timer);
 }
 
-
+/**
+ * @brief Sets timer quantum.
+ *
+ * @param timer_quantum Timer quantum.
+ * @return Void.
+ */
 void sampler_timers_set_quantum(unsigned int timer_quantum)
 {
        sampler_timer_quantum = timer_quantum;
index a68905e..d673b4d 100644 (file)
@@ -1,6 +1,8 @@
-/*
- *  SWAP Sampler
- *  modules/sampler/swap_sampler_errors.h
+/**
+ * @file sampler/swap_sampler_errors.h
+ * @author Alexander Aksenov <a.aksenov@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
  * 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>: Implement SWAP sampler
- *          errors file
+ * @section DESCRIPTION
  *
+ * Sampler error codes.
  */
 
 
+/**
+ * @enum _swap_sampler_errors
+ * @brief Sampler errors.
+ */
 enum _swap_sampler_errors {
-       E_SS_SUCCESS = 0,           /* Success */
-       E_SS_WRONG_QUANTUM = 1      /* Wrong timer quantum set */
+       E_SS_SUCCESS = 0,           /**< Success. */
+       E_SS_WRONG_QUANTUM = 1      /**< Wrong timer quantum set. */
 };
index 1407f28..4528743 100644 (file)
@@ -1,6 +1,9 @@
-/*
- *  SWAP sampler
- *  modules/sampler/swap_sampler_module.c
+/**
+ * sampler/swap_sampler_module.c
+ * @author Andreev S.V.: SWAP Sampler implementation
+ * @author Alexander Aksenov <a.aksenov@samsung.com>: SWAP sampler porting
+ *
+ * @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
  *
- * 2012  Andreev S.V.: SWAP Sampler implementation
- * 2013         Alexander Aksenov <a.aksenov@samsung.com>: SWAP sampler porting
+ * @section DESCRIPTION
  *
+ * Timer-based sampling module.
  */
 
 #include <asm/ptrace.h>
@@ -114,6 +119,13 @@ static void do_swap_sampler_stop(void)
 static DEFINE_MUTEX(mutex_run);
 static int sampler_run = 0;
 
+
+/**
+ * @brief Starts sampling with specified timer quantum.
+ *
+ * @param timer_quantum Timer quantum for sampling.
+ * @return 0 on success, error code on error.
+ */
 int swap_sampler_start(unsigned int timer_quantum)
 {
        int ret = -EINVAL;
@@ -135,6 +147,12 @@ unlock:
 }
 EXPORT_SYMBOL_GPL(swap_sampler_start);
 
+
+/**
+ * @brief Stops sampling.
+ *
+ * @return 0 on success, error code on error.
+ */
 int swap_sampler_stop(void)
 {
        int ret = 0;
index bc1accf..e3663df 100644 (file)
@@ -1,6 +1,8 @@
-/*
- *  SWAP Sampler
- *  modules/sampler/swap_sampler_module.h
+/**
+ * @file sampler/swap_sampler_module.h
+ * @author Alexander Aksenov <a.aksenov@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
  * 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>: Implement SWAP Sampler
- *              interface
+ * @section DESCRIPTION
  *
+ * Sampling module interface declaration.
  */