summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/bbs.c3
-rw-r--r--mbbsd/cache.c1
-rw-r--r--mbbsd/edit.c1
-rw-r--r--mbbsd/gamble.c1
-rw-r--r--mbbsd/io.c4
-rw-r--r--mbbsd/mail.c1
-rw-r--r--mbbsd/mbbsd.c7
-rw-r--r--mbbsd/more.c1
-rw-r--r--mbbsd/read.c2
-rw-r--r--mbbsd/talk.c7
10 files changed, 28 insertions, 0 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 7a8b98f7..13fe9e43 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -783,6 +783,7 @@ int
do_post(void)
{
boardheader_t *bp;
+ STATINC(STAT_DOPOST);
bp = getbcache(currbid);
if (bp->brdattr & BRD_VOTEBOARD)
return do_voteboard(0);
@@ -1150,6 +1151,7 @@ read_post(int ent, fileheader_t * fhdr, const char *direct)
if (fhdr->owner[0] == '-')
return READ_SKIP;
+ STATINC(STAT_READPOST);
setdirpath(genbuf, direct, fhdr->filename);
if ((more_result = more(genbuf, YEA)) == -1)
@@ -1771,6 +1773,7 @@ recommend(int ent, fileheader_t * fhdr, const char *direct)
getans("確定要\033[%s\033[m嗎? 請仔細考慮(Y/N)?[n]", ctype[type]) != 'y')
return FULLUPDATE;
+ STATINC(STAT_RECOMMEND);
#ifdef OLDRECOMMEND
snprintf(buf, sizeof(buf),
"\033[1;31m→ \033[33m%s\033[m\033[33m:%-*s\033[m"
diff --git a/mbbsd/cache.c b/mbbsd/cache.c
index d1771d49..703f0855 100644
--- a/mbbsd/cache.c
+++ b/mbbsd/cache.c
@@ -195,6 +195,7 @@ int
searchuser(const char *userid, char *rightid)
{
int h, p, times;
+ STATINC(STAT_SEARCHUSER);
h = StringHash(userid)%(1<<HASH_BITS);
p = SHM->hash_head[h];
diff --git a/mbbsd/edit.c b/mbbsd/edit.c
index 6ce46305..7316643e 100644
--- a/mbbsd/edit.c
+++ b/mbbsd/edit.c
@@ -2431,6 +2431,7 @@ vedit(char *fpath, int saveheader, int *islocal)
textline_t *oldcurrline;
char trans_buffer[256];
+ STATINC(STAT_VEDIT);
currutmp->mode = EDITING;
currutmp->destuid = currstat;
diff --git a/mbbsd/gamble.c b/mbbsd/gamble.c
index 447c7102..3889577a 100644
--- a/mbbsd/gamble.c
+++ b/mbbsd/gamble.c
@@ -143,6 +143,7 @@ ticket(int bid)
char betname[MAX_ITEM][MAX_ITEM_LEN];
boardheader_t *bh = NULL;
+ STATINC(STAT_GAMBLE);
if (bid) {
bh = getbcache(bid);
setbpath(path, bh->brdname);
diff --git a/mbbsd/io.c b/mbbsd/io.c
index 94e2a849..7155eda9 100644
--- a/mbbsd/io.c
+++ b/mbbsd/io.c
@@ -32,6 +32,7 @@ void
oflush(void)
{
if (obufsize) {
+ STATINC(STAT_SYSWRITESOCKET);
#ifdef CONVERT
write_wrapper(1, outbuf, obufsize);
#else
@@ -54,6 +55,7 @@ output(const char *s, int len)
assert(len<OBUFSIZE);
if (obufsize + len > OBUFSIZE) {
+ STATINC(STAT_SYSWRITESOCKET);
#ifdef CONVERT
write_wrapper(1, outbuf, obufsize);
#else
@@ -138,6 +140,7 @@ dogetch(void)
/* jochang: modify first argument of select from FD_SETSIZE */
/* since we are only waiting input from fd 0 and i_newfd(>0) */
+ STATINC(STAT_SYSSELECT);
while ((len = select(i_newfd + 1, &readfds, NULL, NULL,
i_top ? &timeout : NULL)) < 0) {
if (errno != EINTR)
@@ -172,6 +175,7 @@ dogetch(void)
do{
#endif
+ STATINC(STAT_SYSREADSOCKET);
#ifdef CONVERT
while ((len = read_wrapper(0, inbuf, IBUFSIZE)) <= 0) {
#else
diff --git a/mbbsd/mail.c b/mbbsd/mail.c
index e60f1df8..8e0c5d1c 100644
--- a/mbbsd/mail.c
+++ b/mbbsd/mail.c
@@ -225,6 +225,7 @@ do_send(const char *userid, const char *title)
int internet_mail, i;
userec_t xuser;
+ STATINC(STAT_DOSEND);
if (strchr(userid, '@'))
internet_mail = 1;
else {
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index 84c26470..e8447a1f 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -230,6 +230,7 @@ mysrand(void)
void
talk_request(int sig)
{
+ STATINC(STAT_TALKREQUEST);
bell();
bell();
if (currutmp->msgcount) {
@@ -363,6 +364,7 @@ write_request(int sig)
{
int i, msgcount;
+ STATINC(STAT_WRITEREQUEST);
#ifdef NOKILLWATERBALL
if( reentrant_write_request ) /* kill again by shmctl */
return;
@@ -1058,6 +1060,7 @@ start_client(void)
setrlimit(RLIMIT_CPU, &rml);
#endif
+ STATINC(STAT_LOGIN);
/* system init */
nice(2); /* Ptt: lower priority */
login_start_time = time(0);
@@ -1333,11 +1336,15 @@ static int
shell_login(int argc, char *argv[], char *envp[])
{
+ STATINC(STAT_SHELLLOGIN);
/* Give up root privileges: no way back from here */
setgid(BBSGID);
setuid(BBSUID);
chdir(BBSHOME);
+#if defined(linux) && defined(DEBUG)
+// mtrace();
+#endif
use_shell_login_mode = 1;
initsetproctitle(argc, argv, envp);
diff --git a/mbbsd/more.c b/mbbsd/more.c
index 9ea28a40..10ca8a83 100644
--- a/mbbsd/more.c
+++ b/mbbsd/more.c
@@ -155,6 +155,7 @@ more(char *fpath, int promptend)
struct MorePool mp;
/* Ptt */
+ STATINC(STAT_MORE);
memset(pagebreak, 0, sizeof(pagebreak));
if (*search_str)
search_char0 = *search_str;
diff --git a/mbbsd/read.c b/mbbsd/read.c
index 0d21d85d..4860a569 100644
--- a/mbbsd/read.c
+++ b/mbbsd/read.c
@@ -317,6 +317,7 @@ thread(const keeploc_t * locmem, int stypen)
int step = (stypen & RS_FORWARD) ? 1 : -1;
char *key;
+ STATINC(STAT_THREAD);
if (stypen & RS_AUTHOR)
key = headers[pos - locmem->top_ln].owner;
else if (stypen & RS_CURRENT)
@@ -394,6 +395,7 @@ select_read(const keeploc_t * locmem, int sr_mode)
static int _mode = 0;
int len, fd, fr, i, count=0, reference = 0;
+ STATINC(STAT_SELECTREAD);
fileheader_t *fh = &headers[locmem->crs_ln - locmem->top_ln];
if(sr_mode & RS_AUTHOR)
{
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index db2d3d35..53e2e061 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -388,6 +388,7 @@ my_query(const char *uident)
MSG_LITTLE_BOY, MSG_LITTLE_GIRL,
MSG_MAN, MSG_WOMAN, MSG_PLANT, MSG_MIME};
+ STATINC(STAT_QUERY);
if ((tuid = getuser(uident, &muser))) {
move(1, 0);
clrtobot();
@@ -1129,6 +1130,7 @@ do_talk(int fd)
struct tm *ptime;
char genbuf[200], fpath[100];
+ STATINC(STAT_DOTALK);
ptime = localtime4(&now);
setuserfile(fpath, "talk_XXXXXX");
@@ -1619,11 +1621,13 @@ friend_descript(const userinfo_t * uentp, char *desc_buf, int desc_buflen)
FILE *fp;
char genbuf[STRLEN];
+ STATINC(STAT_FRIENDDESC);
if((set_friend_bit(currutmp,uentp)|IFH)==0)
return space_buf;
setuserfile(fpath, friend_file[0]);
+ STATINC(STAT_FRIENDDESC_FILE);
if ((fp = fopen(fpath, "r"))) {
snprintf(name, sizeof(name), "%s ", uentp->userid);
len = strlen(name);
@@ -1768,6 +1772,7 @@ pickup_myfriend(pickup_t * friends,
userinfo_t *uentp;
int i, where, frstate, ngets = 0;
+ STATINC(STAT_PICKMYFRIEND);
*badfriend = 0;
*myfriend = *friendme = 1;
for (i = 0; currutmp->friend_online[i] && i < MAX_FRIEND; ++i) {
@@ -1803,6 +1808,8 @@ pickup_bfriend(pickup_t * friends, int base)
userinfo_t *uentp;
int i, ngets = 0;
int currsorted = SHM->currsorted, number = SHM->UTMPnumber;
+
+ STATINC(STAT_PICKBFRIEND);
friends = friends + base;
for (i = 0; i < number && ngets < MAX_FRIEND - base; ++i) {
uentp = &SHM->uinfo[SHM->sorted[currsorted][0][i]];