我在 linux 中编写了两个系统调用,并在系统调用中使用 getrusage 测量它们的资源使用情况。但是,我得到的大多数结果都是 0,我不确定这是否有意义。这是输出:
[ 4103.028728] DELTA RESULTS:
[ 4103.028746] u.tv_sec: 0
[ 4103.028748] s.tv_sec: 0
[ 4103.028749] u.tv_usec: 0
[ 4103.028751] s.tv_usec: 971765
[ 4103.028753] maxrss: 0
[ 4103.028755] ixrss: 0
[ 4103.028756] idrss: 0
[ 4103.028758] isrss: 0
[ 4103.028760] minflt: 0
[ 4103.028761] majflt: 0
[ 4103.028763] nswap: 0
[ 4103.028765] inblock: 0
[ 4103.028766] oublock: 0
[ 4103.028768] msgsnd: 0
[ 4103.028769] msgrcv: 0
[ 4103.028771] nsignals: 0
[ 4103.028773] nvcsw: 199
[ 4103.028774] nivcsw: 5
[ 4103.028961] CONTROL RESULTS:
[ 4103.028966] u.tv_sec: 0
[ 4103.028968] s.tv_sec: 0
[ 4103.028970] u.tv_usec: 1383
[ 4103.028972] s.tv_usec: 971998
[ 4103.028974] maxrss: 2492
[ 4103.028975] ixrss: 0
[ 4103.028977] idrss: 0
[ 4103.028978] isrss: 0
[ 4103.028980] minflt: 75
[ 4103.028982] majflt: 0
[ 4103.028984] nswap: 0
[ 4103.028986] inblock: 24
[ 4103.028987] oublock: 0
[ 4103.028989] msgsnd: 0
[ 4103.028991] msgrcv: 0
[ 4103.028992] nsignals: 0
[ 4103.028994] nvcsw: 200
[ 4103.028996] nivcsw: 5
我只是想知道这个输出是否可以通过,或者它是否表明有问题,所以我没有放任何源代码。谢谢!