- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用perf_event_open
syscall编写一段代码。但是我不了解在内存映射中返回的结构中id
和stream_id
字段之间的真正区别。
这种结构是这样的(来自perf_event_open
的手册页):
struct {
struct perf_event_header header;
u64 sample_id; /* if PERF_SAMPLE_IDENTIFIER */
u64 ip; /* if PERF_SAMPLE_IP */
u32 pid, tid; /* if PERF_SAMPLE_TID */
u64 time; /* if PERF_SAMPLE_TIME */
u64 addr; /* if PERF_SAMPLE_ADDR */
u64 id; /* if PERF_SAMPLE_ID */
u64 stream_id; /* if PERF_SAMPLE_STREAM_ID */
u32 cpu, res; /* if PERF_SAMPLE_CPU */
u64 period; /* if PERF_SAMPLE_PERIOD */
struct read_format v;
/* if PERF_SAMPLE_READ */
u64 nr; /* if PERF_SAMPLE_CALLCHAIN */
u64 ips[nr]; /* if PERF_SAMPLE_CALLCHAIN */
u32 size; /* if PERF_SAMPLE_RAW */
char data[size]; /* if PERF_SAMPLE_RAW */
u64 bnr; /* if PERF_SAMPLE_BRANCH_STACK */
struct perf_branch_entry lbr[bnr];
/* if PERF_SAMPLE_BRANCH_STACK */
u64 abi; /* if PERF_SAMPLE_REGS_USER */
u64 regs[weight(mask)];
/* if PERF_SAMPLE_REGS_USER */
u64 size; /* if PERF_SAMPLE_STACK_USER */
char data[size]; /* if PERF_SAMPLE_STACK_USER */
u64 dyn_size; /* if PERF_SAMPLE_STACK_USER &&
size != 0 */
u64 weight; /* if PERF_SAMPLE_WEIGHT */
u64 data_src; /* if PERF_SAMPLE_DATA_SRC */
u64 transaction; /* if PERF_SAMPLE_TRANSACTION */
u64 abi; /* if PERF_SAMPLE_REGS_INTR */
u64 regs[weight(mask)];
/* if PERF_SAMPLE_REGS_INTR */
};
id If PERF_SAMPLE_ID is enabled, a 64-bit unique ID is included. If the event is a member of an event group, the group leader ID is returned. This ID is the same as the one returned by PERF_FORMAT_ID.
stream_id If PERF_SAMPLE_STREAM_ID is enabled, a 64-bit unique ID is included. Unlike PERF_SAMPLE_ID the actual ID is returned, not the group leader. This ID is the same as the one returned by PERF_FORMAT_ID.
最佳答案
出现PERF_SAMPLE_STREAM_ID
的主要原因是维护继承计数器的事件ID。而PERF_SAMPLE_ID
将包含父计数器的事件ID。 (如果有任何父子关系)。
继承的计数器是分配给子任务的那些计数器,这些计数器源自正在配置的父任务(除非将标志--no-inherit
传递给perf
命令)。
此详细信息在此旧commit中进行了描述。
查看最新的源代码here,
if (sample_type & (PERF_SAMPLE_ID | PERF_SAMPLE_IDENTIFIER))
data->id = primary_event_id(event);
if (sample_type & PERF_SAMPLE_STREAM_ID)
data->stream_id = event->id;
....
/*
* If we inherit events we want to return the parent event id
* to userspace.
*/
static u64 primary_event_id(struct perf_event *event)
{
u64 id = event->id;
if (event->parent)
id = event->parent->id;
return id;
}
primary_event_id
函数。可以看到
here。因此,组中的所有事件将包含组长的ID。
关于c++ - “id”系统调用通过选项 “stream_id”返回的结构中的 “PERF_RECORD_SAMPLE”和 “perf_event_open”有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60316869/
我在 BigQuery 中有一些 Firebase 事件数据表,许多(记录不完整的)列之一是“stream_id”。有谁知道这个列代表什么以及它可以用来做什么?它是否代表一个独特的 session ?
我尝试使用 File I/O API 将图像文件插入到 SQL Server FileTable 目录中。我需要获取 stream_id插入图像并将其用作另一个表作为外键。 任何人都可以帮助我,我如何
我正在尝试使用perf_event_open syscall编写一段代码。但是我不了解在内存映射中返回的结构中id和stream_id字段之间的真正区别。 这种结构是这样的(来自perf_event_
我是一名优秀的程序员,十分优秀!