.\" Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. .\" and Copyright (C) 2013 Michael Kerrisk .\" Written by Ivana Varekova .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH PERFMONCTL 2 2013\-02\-13 Linux "Linux Programmer's Manual" .SH 名前 perfmonctl \- IA\-64 の PMU (性能監視ユニット) のインターフェース .SH 書式 .nf \fB#include \fP \fB#include \fP .sp \fBlong perfmonctl(int \fP\fIfd\fP\fB, int \fP\fIcmd\fP\fB, void *\fP\fIarg\fP\fB, int \fP\fInarg\fP\fB);\fP .fi \fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 IA\-64 固有の \fBperfmonctl\fP() システムコールは PMU (性能監視ユニット; performance monitoring unit) へのインターフェースを提供する。 PMU は PMD (performance monitoring data) レジスターと PMC (performance monitoring control) レジスターで構成され、 ハードウェアの統計を収集する。 \fBperfmonctl\fP() は、 操作 \fIcmd\fP を \fIarg\fP で指定された入力引き数で行う。 引き数の数は \fInarg\fP で規定される。 \fIfd\fP 引き数は操作対象の perfmon コンテキストを指定する。 \fIcmd\fP に指定できる値は以下のとおりである。 .TP \fBPFM_CREATE_CONTEXT\fP .nf \fBperfmonctl(int \fP\fIfd\fP\fB, PFM_CREATE_CONTEXT, pfarg_context_t *\fP\fIctxt\fP\fB, 1);\fP .fi コンテキストを用意する。 \fIfd\fP 引き数は無視される。 新しい perfmon コンテキストを \fIctxt\fP で指定した内容で作成し、 そのファイルディスクリプターを \fIctxt\->ctx_fd\fP で返す。 ファイルディスクリプターはそれ以降の \fBperfmonctl\fP() の呼び出しで使用したり、 \fBread\fP(2) を使ってイベント通知 (\fIpfm_msg_t\fP 型) を読み出したりするのに使用できる。 このファイルディスクリプターは \fBselect\fP(2), \fBpoll\fP(2), \fBepoll\fP(7) で状態監視 (ポーリング) することができる。 コンテキストを破棄するには、 そのファイルディスクリプターに対して \fBclose\fP(2) を呼び出す。 .TP \fBPFM_WRITE_PMCS\fP .\" pfm_write_pmcs() .nf \fBperfmonctl(int \fP\fIfd\fP\fB, PFM_WRITE_PMCS, pfarg_reg_t *\fP\fIpmcs\fP\fB, n);\fP .fi PMC レジスターを設定する。 .TP \fBPFM_WRITE_PMDS\fP .nf \fBperfmonctl(int \fP\fIfd\fP\fB, PFM_WRITE_PMDS, pfarg_reg_t *\fP\fIpmds\fP\fB, n);\fP .fi .\" pfm_write_pmds() PMD レジスターを設定する。 .TP \fBPFM_READ_PMDS\fP .\" pfm_read_pmds() .nf \fBperfmonctl(int \fP\fIfd\fP\fB, PFM_READ_PMDS, pfarg_reg_t *\fP\fIpmds\fP\fB, n);\fP .fi PMD レジスターを読み出す。 .TP \fBPFM_START\fP .\" pfm_start() .nf .\" .BI "perfmonctl(int " fd ", PFM_START, arg, 1); \fBperfmonctl(int \fP\fIfd\fP\fB, PFM_START, NULL, 0);\fP .fi 監視を開始する。 .TP \fBPFM_STOP\fP .\" pfm_stop() .nf \fBperfmonctl(int \fP\fIfd\fP\fB, PFM_STOP, NULL, 0);\fP .fi 監視を停止する。 .TP \fBPFM_LOAD_CONTEXT\fP .\" pfm_context_load() .nf \fBperfmonctl(int \fP\fIfd\fP\fB, PFM_LOAD_CONTEXT, pfarg_load_t *\fP\fIlargs\fP\fB, 1);\fP .fi 指定したコンテキストをスレッドに接続する。 .TP \fBPFM_UNLOAD_CONTEXT\fP .\" pfm_context_unload() .nf \fBperfmonctl(int \fP\fIfd\fP\fB, PFM_UNLOAD_CONTEXT, NULL, 0);\fP .fi 指定したコンテキストをスレッドが切り離す。 .TP \fBPFM_RESTART\fP .\" pfm_restart() .nf \fBperfmonctl(int \fP\fIfd\fP\fB, PFM_RESTART, NULL, 0);\fP .fi オーバーフロー通知を受信した後、 監視を再開する。 .TP \fBPFM_GET_FEATURES\fP .\" pfm_get_features() .nf \fBperfmonctl(int \fP\fIfd\fP\fB, PFM_GET_FEARURES, pfarg_features_t *\fP\fIarg\fP\fB, 1);\fP .fi .TP \fBPFM_DEBUG\fP .\" pfm_debug() .nf \fBperfmonctl(int \fP\fIfd\fP\fB, PFM_DEBUG, \fP\fIval\fP\fB, 0);\fP .fi \fIval\fP が 0 以外の場合、デバッグモードを有効にする。 そうでない場合、 無効にする。 .TP \fBPFM_GET_PMC_RESET_VAL\fP .\" pfm_get_pmc_reset() .nf \fBperfmonctl(int \fP\fIfd\fP\fB, PFM_GET_PMC_RESET_VAL, pfarg_reg_t * \fP\fIreq\fP\fB, n);\fP .fi .\" .\" .\" .TP .\" .B PFM_CREATE_EVTSETS .\" .\" create or modify event sets .\" .nf .\" .BI "perfmonctl(int " fd ", PFM_CREATE_EVTSETS, pfarg_setdesc_t *desc , n); .\" .fi .\" .TP .\" .B PFM_DELETE_EVTSETS .\" delete event sets .\" .nf .\" .BI "perfmonctl(int " fd ", PFM_DELETE_EVTSET, pfarg_setdesc_t *desc , n); .\" .fi .\" .TP .\" .B PFM_GETINFO_EVTSETS .\" get information about event sets .\" .nf .\" .BI "perfmonctl(int " fd ", PFM_GETINFO_EVTSETS, pfarg_setinfo_t *info, n); .\" .fi PMC レジスターをデフォルト値にリセットする。 .SH 返り値 \fBperfmonctl\fP() は操作が成功すると 0 を返す。 エラーの場合、 \-1 が返り、 \fIerrno\fP にエラーの原因を示す値が設定される。 .SH バージョン \fBperfmonctl\fP() は Linux 2.4 以降で利用可能である。 .SH 準拠 \fBperfmonctl\fP() は Linux 固有で、 IA\-64 アーキテクチャーでのみ利用できる。 .SH 注意 glibc はこのシステムコールに対するラッパー関数を提供していない。 \fBsyscall\fP(2) を使って呼び出すこと。 .SH 関連項目 \fBgprof\fP(1) perfmon2 インターフェース仕様 .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。