GadgetSeed  0.9.6
com_task.c ファイル

タスク関連コマンド [詳解]

#include "sysconfig.h"
#include "shell.h"
#include "str.h"
#include "tkprintf.h"
#include "tprintf.h"
#include "task/task.h"
#include "task/syscall.h"
#include "task/calltrace.h"
#include "dtprintf.h"
com_task.c の依存先関係図:

[ソースコード]

マクロ定義

#define GSC_KERNEL_MESSAGEOUT_MEMORY_SIZE   (1024 * 3)
 $gsc カーネルメッセージ出力メモリサイズ
 
#define GSC_MAX_TASK_INFO_NUM   10
 $gsc topコマンドで表示可能な最大タスク数
 

関数

static int task_top (int argc, uchar *argv[])
 
static int task_list (int argc, uchar *argv[])
 
static int task_queue (int argc, uchar *argv[])
 
static int command_task_kill (int argc, uchar *argv[])
 

変数

static unsigned char kmess_buff [GSC_KERNEL_MESSAGEOUT_MEMORY_SIZE]
 
static struct st_task_info task_info_list [GSC_MAX_TASK_INFO_NUM]
 
static unsigned int last_run_time [GSC_MAX_TASK_INFO_NUM]
 
static const struct st_shell_command com_task_top
 実行中タスクのCPU使用率を表示する [詳解]
 
static const struct st_shell_command com_task_list
 実行中タスクの状態を表示する [詳解]
 
static const struct st_shell_command com_task_queue
 各タスクキューに登録されているタスクを表示する [詳解]
 
static const struct st_shell_command com_task_kill
 任意のタスクを終了させる [詳解]
 
static const struct st_shell_command *const com_task_com_list []
 
const struct st_shell_command com_task
 タスク状態取得 [詳解]
 

詳解

タスク関連コマンド

日付
2012.01.22
著者
Takashi SHUDO

taskコマンド

task コマンドには以下のサブコマンドがあります。

サブコマンド 機能 詳細
top 実行中タスクのCPU使用率を表示する com_task_top
list 実行中タスクの状態を表示する com_task_list
queue 各タスクキューに登録されているタスクを表示する com_task_queue
kill 任意のタスクを終了させる com_task_kill
calltrace com_task_calltrace

com_task.c に定義があります。

変数詳解

◆ com_task

const struct st_shell_command com_task
初期値:
= {
.name = "task",
.manual_str = "Task operation commands",
.sublist = com_task_com_list
}

タスク状態取得

com_task.c226 行目に定義があります。

◆ com_task_com_list

const struct st_shell_command* const com_task_com_list[]
static
初期値:
= {
0
}
static const struct st_shell_command com_task_queue
各タスクキューに登録されているタスクを表示する
Definition: com_task.c:156
static const struct st_shell_command com_task_list
実行中タスクの状態を表示する
Definition: com_task.c:134
static const struct st_shell_command com_task_kill
任意のタスクを終了させる
Definition: com_task.c:168
static const struct st_shell_command com_task_top
実行中タスクのCPU使用率を表示する
Definition: com_task.c:111

com_task.c215 行目に定義があります。

◆ com_task_kill

const struct st_shell_command com_task_kill
static
初期値:
= {
.name = "kill",
.command = command_task_kill,
.usage_str = "<PID>",
.manual_str = "Kill task"
}

任意のタスクを終了させる

com_task.c168 行目に定義があります。

◆ com_task_list

const struct st_shell_command com_task_list
static
初期値:
= {
.name = "list",
.command = task_list,
.manual_str = "Print task list"
}

実行中タスクの状態を表示する

com_task.c134 行目に定義があります。

◆ com_task_queue

const struct st_shell_command com_task_queue
static
初期値:
= {
.name = "queue",
.command = task_queue,
.manual_str = "Print task queue"
}

各タスクキューに登録されているタスクを表示する

com_task.c156 行目に定義があります。

◆ com_task_top

const struct st_shell_command com_task_top
static
初期値:
= {
.name = "top",
.command = task_top,
.usage_str = "top [\"s\"(scroll)]",
.manual_str = "Print task load"
}

実行中タスクのCPU使用率を表示する

com_task.c111 行目に定義があります。