Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit96112ee

Browse files
committed
Revert "Add some temporary code to record stack usage at server process exit."
This reverts commit88cf37d as wellas follow-on commitsea9c4a1 andc575627. We've learned about as muchas we can from the buildfarm.
1 parent30b2731 commit96112ee

File tree

2 files changed

+0
-85
lines changed

2 files changed

+0
-85
lines changed

‎src/backend/storage/ipc/ipc.c

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
#include<signal.h>
2323
#include<unistd.h>
2424
#include<sys/stat.h>
25-
#if defined(__hpux)
26-
#include<sys/param.h>
27-
#include<sys/pstat.h>
28-
#endif
2925

3026
#include"miscadmin.h"
3127
#ifdefPROFILE_PID_DIR
@@ -35,9 +31,6 @@
3531
#include"storage/ipc.h"
3632
#include"tcop/tcopprot.h"
3733

38-
externlongmax_measured_stack_depth;
39-
externlongmax_measured_register_stack_depth;
40-
4134

4235
/*
4336
* This flag is set during proc_exit() to change ereport()'s behavior,
@@ -87,69 +80,6 @@ static inton_proc_exit_index,
8780
before_shmem_exit_index;
8881

8982

90-
/* Report process's stack consumption to stderr */
91-
staticvoid
92-
report_stack_size(void)
93-
{
94-
#if defined(__hpux)
95-
/* HPUX: examine process's memory map with pstat_getprocvm() */
96-
inttargetpid=getpid();
97-
intndx;
98-
99-
for (ndx=0;;ndx++)
100-
{
101-
structpst_vm_statusbuf;
102-
constchar*pagetype;
103-
intres;
104-
105-
res=pstat_getprocvm(&buf,sizeof(buf),targetpid,ndx);
106-
if (res<0)
107-
{
108-
perror("getprocvm");
109-
break;
110-
}
111-
if (res!=1)
112-
break;
113-
switch (buf.pst_type)
114-
{
115-
casePS_STACK:
116-
pagetype="STACK";
117-
break;
118-
#ifdefPS_RSESTACK
119-
casePS_RSESTACK:
120-
pagetype="REGSTACK";
121-
break;
122-
#endif
123-
default:
124-
continue;
125-
}
126-
fprintf(stderr,"%d: stack addr 0x%lx, length %ld, physical pages %ld, type %s\n",
127-
targetpid,
128-
buf.pst_vaddr,
129-
buf.pst_length,
130-
buf.pst_phys_pages,
131-
pagetype);
132-
}
133-
#else/* non HPUX */
134-
/* Otherwise: try to use pmap. No error if that doesn't work. */
135-
charsysbuf[128];
136-
137-
snprintf(sysbuf,sizeof(sysbuf),"pmap -x %d | grep -i stack 1>&2",
138-
(int)getpid());
139-
(void)system(sysbuf);
140-
#endif
141-
142-
#if defined(__ia64__)|| defined(__ia64)
143-
fprintf(stderr,"max measured stack depths %ldkB, %ldkB\n",
144-
(max_measured_stack_depth+1023) /1024,
145-
(max_measured_register_stack_depth+1023) /1024);
146-
#else
147-
fprintf(stderr,"max measured stack depth %ldkB\n",
148-
(max_measured_stack_depth+1023) /1024);
149-
#endif
150-
}
151-
152-
15383
/* ----------------------------------------------------------------
15484
*proc_exit
15585
*
@@ -171,9 +101,6 @@ proc_exit(int code)
171101
/* Clean up everything that must be cleaned up */
172102
proc_exit_prepare(code);
173103

174-
/* report stack size to stderr */
175-
report_stack_size();
176-
177104
#ifdefPROFILE_PID_DIR
178105
{
179106
/*

‎src/backend/tcop/postgres.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,6 @@ intmax_stack_depth = 100;
9696
/* wait N seconds to allow attach from a debugger */
9797
intPostAuthDelay=0;
9898

99-
/* Exported for use by proc_exit */
100-
longmax_measured_stack_depth=0;
101-
longmax_measured_register_stack_depth=0;
10299

103100

104101
/* ----------------
@@ -3140,11 +3137,6 @@ stack_is_too_deep(void)
31403137
if (stack_depth<0)
31413138
stack_depth=-stack_depth;
31423139

3143-
/* Track max measured depth for reporting by proc_exit */
3144-
if (stack_depth>max_measured_stack_depth&&
3145-
stack_base_ptr!=NULL)
3146-
max_measured_stack_depth=stack_depth;
3147-
31483140
/*
31493141
* Trouble?
31503142
*
@@ -3168,10 +3160,6 @@ stack_is_too_deep(void)
31683160
#if defined(__ia64__)|| defined(__ia64)
31693161
stack_depth= (long) (ia64_get_bsp()-register_stack_base_ptr);
31703162

3171-
if (stack_depth>max_measured_register_stack_depth&&
3172-
register_stack_base_ptr!=NULL)
3173-
max_measured_register_stack_depth=stack_depth;
3174-
31753163
if (stack_depth>max_stack_depth_bytes&&
31763164
register_stack_base_ptr!=NULL)
31773165
return true;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp