首页
社区
课程
招聘
内核下做日志记录 怎么解决CPU占用率居高不下
发表于: 2010-1-8 22:08 4651

内核下做日志记录 怎么解决CPU占用率居高不下

2010-1-8 22:08
4651
//写数据
VOID WriteProcessLog(PVOID context)
{
	do
	{
		//KdPrint(("[WriteData]\n"));
		while( pHead->next!=NULL )//表示有数据
		{
			//取数据
			UNICODE_STRING pLogFile;
			PPROCESS log;
			//打开文件,失败创建
			log = (PPROCESS)ExAllocatePool(NonPagedPool,sizeof(PROCESS));
			GiveProcessLog(log);
			//从log中取出时间,拼合成日志文件路径
			InitPath(log->Time,LogPath,".process", &pLogFile);
			KdPrint(("[InitPath] pLogFile:%wZ\n",&pLogFile));
			//
			WriteData(&pLogFile,log,sizeof(PROCESS));
			//释放内存
			RtlFreeUnicodeString(&pLogFile);
			ExFreePool(log);

		}
		KernelSleep(120000);      //给我睡2分钟
	}while(pFlags);
	//线程结束
	PsTerminateSystemThread(STATUS_SUCCESS);
}

[课程]FART 脱壳王!加量不加价!FART作者讲授!

收藏
免费 0
支持
分享
最新回复 (7)
雪    币: 170
活跃值: (90)
能力值: ( LV12,RANK:210 )
在线值:
发帖
回帖
粉丝
2
内核下做日志记录  我想到的是创建个线程不停遍历数据链表
2010-1-8 22:09
0
雪    币: 1337
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
看看windows或是Linux源码,有没有这么做?
2010-1-8 22:10
0
雪    币: 284
活跃值: (106)
能力值: ( LV9,RANK:160 )
在线值:
发帖
回帖
粉丝
4
最好不要一直在读写文件,个人觉得做一个大一点的数据缓冲,等满了再写(捕获到关机就不满也写),如果数据量不是相当变态的话,加上延时cpu不会一直居高不下的
2010-1-9 14:36
0
雪    币: 109
活跃值: (10)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
5
这样的可以用定时器写么?比如dpc
2010-1-9 14:49
0
雪    币: 635
活跃值: (101)
能力值: ( LV12,RANK:420 )
在线值:
发帖
回帖
粉丝
6
自己写个什么劲,用wmi , ioxxxxx或clfs...
2010-1-9 15:00
0
雪    币: 170
活跃值: (90)
能力值: ( LV12,RANK:210 )
在线值:
发帖
回帖
粉丝
7
太深奥了啊  
2010-1-9 16:35
0
雪    币: 170
活跃值: (90)
能力值: ( LV12,RANK:210 )
在线值:
发帖
回帖
粉丝
8
IRQL_NOT_LESS_OR_EQUAL (a)
An attempt was made to access a pageable (or completely invalid) address at an
interrupt request level (IRQL) that is too high.  This is usually
caused by drivers using improper addresses.
If a kernel debugger is available get the stack backtrace.
Arguments:
Arg1: 0104a000, memory referenced
Arg2: 00000002, IRQL
Arg3: 00000000, value 0 = read operation, 1 = write operation
Arg4: 805aa55a, address which referenced memory

Debugging Details:
------------------
2010-1-9 16:47
0
游客
登录 | 注册 方可回帖
返回
//