2006-07-24 18:32:45 +02:00
|
|
|
/* ----------
|
|
|
|
* DTrace probes for PostgreSQL backend
|
|
|
|
*
|
2020-01-01 18:21:45 +01:00
|
|
|
* Copyright (c) 2006-2020, PostgreSQL Global Development Group
|
2006-07-24 18:32:45 +02:00
|
|
|
*
|
2010-09-20 22:08:53 +02:00
|
|
|
* src/backend/utils/probes.d
|
2006-07-24 18:32:45 +02:00
|
|
|
* ----------
|
|
|
|
*/
|
|
|
|
|
2008-08-01 15:16:09 +02:00
|
|
|
|
2009-03-12 00:19:25 +01:00
|
|
|
/*
|
2019-11-06 17:11:40 +01:00
|
|
|
* Typedefs used in PostgreSQL probes.
|
2009-03-12 00:19:25 +01:00
|
|
|
*
|
|
|
|
* NOTE: Do not use system-provided typedefs (e.g. uintptr_t, uint32_t, etc)
|
2019-11-06 17:11:40 +01:00
|
|
|
* in probe definitions, as they cause compilation errors on macOS.
|
2009-03-12 00:19:25 +01:00
|
|
|
*/
|
2008-12-17 02:39:04 +01:00
|
|
|
#define LocalTransactionId unsigned int
|
|
|
|
#define LWLockMode int
|
|
|
|
#define LOCKMODE int
|
|
|
|
#define BlockNumber unsigned int
|
|
|
|
#define Oid unsigned int
|
|
|
|
#define ForkNumber int
|
2019-11-06 17:11:40 +01:00
|
|
|
#define bool unsigned char
|
2008-08-01 15:16:09 +02:00
|
|
|
|
2006-07-24 18:32:45 +02:00
|
|
|
provider postgresql {
|
|
|
|
|
2008-08-01 15:16:09 +02:00
|
|
|
probe transaction__start(LocalTransactionId);
|
|
|
|
probe transaction__commit(LocalTransactionId);
|
|
|
|
probe transaction__abort(LocalTransactionId);
|
|
|
|
|
2016-12-16 17:29:23 +01:00
|
|
|
probe lwlock__acquire(const char *, LWLockMode);
|
|
|
|
probe lwlock__release(const char *);
|
|
|
|
probe lwlock__wait__start(const char *, LWLockMode);
|
|
|
|
probe lwlock__wait__done(const char *, LWLockMode);
|
|
|
|
probe lwlock__condacquire(const char *, LWLockMode);
|
|
|
|
probe lwlock__condacquire__fail(const char *, LWLockMode);
|
|
|
|
probe lwlock__acquire__or__wait(const char *, LWLockMode);
|
|
|
|
probe lwlock__acquire__or__wait__fail(const char *, LWLockMode);
|
2008-08-01 15:16:09 +02:00
|
|
|
|
2009-03-23 02:52:38 +01:00
|
|
|
probe lock__wait__start(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, LOCKMODE);
|
|
|
|
probe lock__wait__done(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, LOCKMODE);
|
2008-08-01 15:16:09 +02:00
|
|
|
|
|
|
|
probe query__parse__start(const char *);
|
|
|
|
probe query__parse__done(const char *);
|
|
|
|
probe query__rewrite__start(const char *);
|
|
|
|
probe query__rewrite__done(const char *);
|
|
|
|
probe query__plan__start();
|
|
|
|
probe query__plan__done();
|
|
|
|
probe query__execute__start();
|
|
|
|
probe query__execute__done();
|
|
|
|
probe query__start(const char *);
|
|
|
|
probe query__done(const char *);
|
|
|
|
probe statement__status(const char *);
|
|
|
|
|
Support parallel btree index builds.
To make this work, tuplesort.c and logtape.c must also support
parallelism, so this patch adds that infrastructure and then applies
it to the particular case of parallel btree index builds. Testing
to date shows that this can often be 2-3x faster than a serial
index build.
The model for deciding how many workers to use is fairly primitive
at present, but it's better than not having the feature. We can
refine it as we get more experience.
Peter Geoghegan with some help from Rushabh Lathia. While Heikki
Linnakangas is not an author of this patch, he wrote other patches
without which this feature would not have been possible, and
therefore the release notes should possibly credit him as an author
of this feature. Reviewed by Claudio Freire, Heikki Linnakangas,
Thomas Munro, Tels, Amit Kapila, me.
Discussion: http://postgr.es/m/CAM3SWZQKM=Pzc=CAHzRixKjp2eO5Q0Jg1SoFQqeXFQ647JiwqQ@mail.gmail.com
Discussion: http://postgr.es/m/CAH2-Wz=AxWqDoVvGU7dq856S4r6sJAj6DBn7VMtigkB33N5eyg@mail.gmail.com
2018-02-02 19:25:55 +01:00
|
|
|
probe sort__start(int, bool, int, int, bool, int);
|
2009-03-12 00:19:25 +01:00
|
|
|
probe sort__done(bool, long);
|
2008-08-01 15:16:09 +02:00
|
|
|
|
2010-08-14 00:54:17 +02:00
|
|
|
probe buffer__read__start(ForkNumber, BlockNumber, Oid, Oid, Oid, int, bool);
|
2010-08-13 22:10:54 +02:00
|
|
|
probe buffer__read__done(ForkNumber, BlockNumber, Oid, Oid, Oid, int, bool, bool);
|
2010-08-14 04:22:10 +02:00
|
|
|
probe buffer__flush__start(ForkNumber, BlockNumber, Oid, Oid, Oid);
|
|
|
|
probe buffer__flush__done(ForkNumber, BlockNumber, Oid, Oid, Oid);
|
2008-08-01 15:16:09 +02:00
|
|
|
|
|
|
|
probe buffer__checkpoint__start(int);
|
2008-12-17 02:39:04 +01:00
|
|
|
probe buffer__checkpoint__sync__start();
|
2008-08-01 15:16:09 +02:00
|
|
|
probe buffer__checkpoint__done();
|
|
|
|
probe buffer__sync__start(int, int);
|
|
|
|
probe buffer__sync__written(int);
|
|
|
|
probe buffer__sync__done(int, int, int);
|
2008-12-17 02:39:04 +01:00
|
|
|
probe buffer__write__dirty__start(ForkNumber, BlockNumber, Oid, Oid, Oid);
|
|
|
|
probe buffer__write__dirty__done(ForkNumber, BlockNumber, Oid, Oid, Oid);
|
2008-08-01 15:16:09 +02:00
|
|
|
|
|
|
|
probe deadlock__found();
|
2006-07-24 18:32:45 +02:00
|
|
|
|
2008-12-17 02:39:04 +01:00
|
|
|
probe checkpoint__start(int);
|
|
|
|
probe checkpoint__done(int, int, int, int, int);
|
2008-08-01 15:16:09 +02:00
|
|
|
probe clog__checkpoint__start(bool);
|
|
|
|
probe clog__checkpoint__done(bool);
|
|
|
|
probe subtrans__checkpoint__start(bool);
|
|
|
|
probe subtrans__checkpoint__done(bool);
|
|
|
|
probe multixact__checkpoint__start(bool);
|
|
|
|
probe multixact__checkpoint__done(bool);
|
|
|
|
probe twophase__checkpoint__start();
|
|
|
|
probe twophase__checkpoint__done();
|
2008-12-17 02:39:04 +01:00
|
|
|
|
2010-08-13 22:10:54 +02:00
|
|
|
probe smgr__md__read__start(ForkNumber, BlockNumber, Oid, Oid, Oid, int);
|
|
|
|
probe smgr__md__read__done(ForkNumber, BlockNumber, Oid, Oid, Oid, int, int, int);
|
|
|
|
probe smgr__md__write__start(ForkNumber, BlockNumber, Oid, Oid, Oid, int);
|
|
|
|
probe smgr__md__write__done(ForkNumber, BlockNumber, Oid, Oid, Oid, int, int, int);
|
2008-12-17 02:39:04 +01:00
|
|
|
|
2017-02-09 22:40:19 +01:00
|
|
|
probe wal__insert(unsigned char, unsigned char);
|
|
|
|
probe wal__switch();
|
2008-12-24 21:41:29 +01:00
|
|
|
probe wal__buffer__write__dirty__start();
|
|
|
|
probe wal__buffer__write__dirty__done();
|
2006-07-24 18:32:45 +02:00
|
|
|
};
|