From: "Александр Берсенев" <bay@hackerdom.ru>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/autodep:master commit in: logger/src/autodep/logfs/, logger/src/hook_fusefs/
Date: Sat, 18 Jun 2011 10:00:16 +0000 (UTC) [thread overview]
Message-ID: <01807c6d423c98886fc71198f031adc7f38845bf.bay@gentoo> (raw)
commit: 01807c6d423c98886fc71198f031adc7f38845bf
Author: Alexander Bersenev <bay <AT> hackerdom <DOT> ru>
AuthorDate: Sat Jun 18 15:59:37 2011 +0000
Commit: Александр Берсенев <bay <AT> hackerdom <DOT> ru>
CommitDate: Sat Jun 18 15:59:37 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/autodep.git;a=commit;h=01807c6d
another performace improvements
---
logger/src/autodep/logfs/fstracer.py | 2 +-
logger/src/hook_fusefs/hookfs.c | 11 +++++++++--
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/logger/src/autodep/logfs/fstracer.py b/logger/src/autodep/logfs/fstracer.py
index fec926c..95d64f5 100644
--- a/logger/src/autodep/logfs/fstracer.py
+++ b/logger/src/autodep/logfs/fstracer.py
@@ -173,7 +173,7 @@ def getfsevents(prog_name,arguments,approach="hooklib",filterproc=defaultfilter)
input.append(client)
buffers[client]=""
else:
- data=s.recv(4096)
+ data=s.recv(65536)
buffers[s]+=data
diff --git a/logger/src/hook_fusefs/hookfs.c b/logger/src/hook_fusefs/hookfs.c
index 3545151..9241a2a 100644
--- a/logger/src/hook_fusefs/hookfs.c
+++ b/logger/src/hook_fusefs/hookfs.c
@@ -46,6 +46,8 @@
#define MAXSOCKETPATHLEN 108
#define MAXFILEBUFFLEN 2048
+#define IOBUFSIZE 65536
+
struct hookfs_config {
int argv_debug;
@@ -202,7 +204,6 @@ static void raw_log_event(const char *event_type, const char *filename, char *re
fprintf(log_file,"%s",result);
fprintf(log_file,"%c%c",0,0);
- fflush(log_file);
}
/*
@@ -229,10 +230,10 @@ static int is_event_allowed(const char *event_type,const char *filename, pid_t p
// sending asking log_event
raw_log_event(event_type,filename,"ASKING",0,stage);
+ fflush(log_file);
char answer[8];
fscanf(log_file,"%7s",answer);
- fflush(log_file); // yes, it is here too
pthread_mutex_unlock( &socketblock );
if(strcmp(answer,"ALLOW")==0)
@@ -1113,6 +1114,12 @@ int main(int argc, char *argv[]) {
fprintf(stderr,"Unable to open a socket for a steam writing: %s\n", strerror(errno));
exit(1);
}
+
+ ret=setvbuf(log_file,NULL,_IOFBF,IOBUFSIZE);
+ if(ret!=0){
+ fprintf(stderr,"Unable to set a size of io buffer");
+ exit(1);
+ }
}
if (! try_chdir_to_mountpoint(args.argc, args.argv)) {
next reply other threads:[~2011-06-18 10:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-18 10:00 Александр Берсенев [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-06-24 20:17 [gentoo-commits] proj/autodep:master commit in: logger/src/autodep/logfs/, logger/src/hook_fusefs/ Александр Берсенев
2011-06-18 8:27 Александр Берсенев
2011-06-08 16:48 Александр Берсенев
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=01807c6d423c98886fc71198f031adc7f38845bf.bay@gentoo \
--to=bay@hackerdom.ru \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox