Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1534266 > unrolled thread
| Started by | Ross Zwisler <ross.zwisler@linux.intel.com> |
|---|---|
| First post | 2016-12-01 17:40 +0100 |
| Last post | 2016-12-01 18:00 +0100 |
| Articles | 8 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH v3 0/5] introduce DAX tracepoint support Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-12-01 17:40 +0100
[PATCH v3 3/5] dax: update MAINTAINERS entries for FS DAX Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-12-01 17:40 +0100
[PATCH v3 1/5] tracing: add __print_flags_u64() Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-12-01 17:40 +0100
Re: [PATCH v3 1/5] tracing: add __print_flags_u64() Steven Rostedt <rostedt@goodmis.org> - 2016-12-01 18:00 +0100
[PATCH v3 4/5] dax: add tracepoints to dax_pmd_load_hole() Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-12-01 17:40 +0100
Re: [PATCH v3 4/5] dax: add tracepoints to dax_pmd_load_hole() Steven Rostedt <rostedt@goodmis.org> - 2016-12-01 18:00 +0100
[PATCH v3 5/5] dax: add tracepoints to dax_pmd_insert_mapping() Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-12-01 17:40 +0100
Re: [PATCH v3 5/5] dax: add tracepoints to dax_pmd_insert_mapping() Steven Rostedt <rostedt@goodmis.org> - 2016-12-01 18:00 +0100
| From | Ross Zwisler <ross.zwisler@linux.intel.com> |
|---|---|
| Date | 2016-12-01 17:40 +0100 |
| Subject | [PATCH v3 0/5] introduce DAX tracepoint support |
| Message-ID | <sJCyR-6te-3@gated-at.bofh.it> |
Tracepoints are the standard way to capture debugging and tracing information in many parts of the kernel, including the XFS and ext4 filesystems. This series creates a tracepoint header for FS DAX and add the first few DAX tracepoints to the PMD fault handler. This allows the tracing for DAX to be done in the same way as the filesystem tracing so that developers can look at them together and get a coherent idea of what the system is doing. I do intend to add tracepoints to the normal 4k DAX fault path and to the DAX I/O path, but I wanted to get feedback on the PMD tracepoints before I went any further. This series is based on Jan Kara's "dax: Clear dirty bits after flushing caches" series: https://lists.01.org/pipermail/linux-nvdimm/2016-November/007864.html I've pushed a git tree with this work here: https://git.kernel.org/cgit/linux/kernel/git/zwisler/linux.git/log/?h=dax_tracepoints_v3 Changes since v2: - Dropped "dax: remove leading space from labels" patch. (Jan) - Reordered TP_STRUCT__entry() fields so that all the 64 bit entries (for 64 bit machines) come first, followed by the 32 bit entries. This allows for optimal packing of the entires. (Steve) - Fixed 'mask' in trace_print_flags_seq_u64() to be an unsigned long long. (Steve) Ross Zwisler (5): tracing: add __print_flags_u64() dax: add tracepoint infrastructure, PMD tracing dax: update MAINTAINERS entries for FS DAX dax: add tracepoints to dax_pmd_load_hole() dax: add tracepoints to dax_pmd_insert_mapping() MAINTAINERS | 5 +- fs/dax.c | 56 ++++++++++----- include/linux/mm.h | 25 +++++++ include/linux/pfn_t.h | 6 ++ include/linux/trace_events.h | 4 ++ include/trace/events/fs_dax.h | 161 ++++++++++++++++++++++++++++++++++++++++++ include/trace/trace_events.h | 11 +++ kernel/trace/trace_output.c | 38 ++++++++++ 8 files changed, 288 insertions(+), 18 deletions(-) create mode 100644 include/trace/events/fs_dax.h -- 2.7.4
[toc] | [next] | [standalone]
| From | Ross Zwisler <ross.zwisler@linux.intel.com> |
|---|---|
| Date | 2016-12-01 17:40 +0100 |
| Subject | [PATCH v3 3/5] dax: update MAINTAINERS entries for FS DAX |
| Message-ID | <sJCyS-6te-13@gated-at.bofh.it> |
| In reply to | #1534266 |
Add the new include/trace/events/fs_dax.h tracepoint header, the existing include/linux/dax.h header, update Matthew's email address and add myself as a maintainer for filesystem DAX. Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com> Suggested-by: Matthew Wilcox <mawilcox@microsoft.com> --- MAINTAINERS | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 2a58eea..b93ea2a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3855,10 +3855,13 @@ S: Maintained F: drivers/i2c/busses/i2c-diolan-u2c.c DIRECT ACCESS (DAX) -M: Matthew Wilcox <willy@linux.intel.com> +M: Matthew Wilcox <mawilcox@microsoft.com> +M: Ross Zwisler <ross.zwisler@linux.intel.com> L: linux-fsdevel@vger.kernel.org S: Supported F: fs/dax.c +F: include/linux/dax.h +F: include/trace/events/fs_dax.h DIRECTORY NOTIFICATION (DNOTIFY) M: Eric Paris <eparis@parisplace.org> -- 2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Ross Zwisler <ross.zwisler@linux.intel.com> |
|---|---|
| Date | 2016-12-01 17:40 +0100 |
| Subject | [PATCH v3 1/5] tracing: add __print_flags_u64() |
| Message-ID | <sJCyS-6te-11@gated-at.bofh.it> |
| In reply to | #1534266 |
Add __print_flags_u64() and the helper trace_print_flags_seq_u64() in the
same spirit as __print_symbolic_u64() and trace_print_symbols_seq_u64().
These functions allow us to print symbols associated with flags that are 64
bits wide even on 32 bit machines.
These will be used by the DAX code so that we can print the flags set in a
pfn_t such as PFN_SG_CHAIN, PFN_SG_LAST, PFN_DEV and PFN_MAP.
Without this new function I was getting errors like the following when
compiling for i386:
./include/linux/pfn_t.h:13:22: warning: large integer implicitly truncated
to unsigned type [-Woverflow]
#define PFN_SG_CHAIN (1ULL << (BITS_PER_LONG_LONG - 1))
^
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
---
include/linux/trace_events.h | 4 ++++
include/trace/trace_events.h | 11 +++++++++++
kernel/trace/trace_output.c | 38 ++++++++++++++++++++++++++++++++++++++
3 files changed, 53 insertions(+)
diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h
index be00761..db2c3ba 100644
--- a/include/linux/trace_events.h
+++ b/include/linux/trace_events.h
@@ -23,6 +23,10 @@ const char *trace_print_symbols_seq(struct trace_seq *p, unsigned long val,
const struct trace_print_flags *symbol_array);
#if BITS_PER_LONG == 32
+const char *trace_print_flags_seq_u64(struct trace_seq *p, const char *delim,
+ unsigned long long flags,
+ const struct trace_print_flags_u64 *flag_array);
+
const char *trace_print_symbols_seq_u64(struct trace_seq *p,
unsigned long long val,
const struct trace_print_flags_u64
diff --git a/include/trace/trace_events.h b/include/trace/trace_events.h
index 467e12f..c6e9f72 100644
--- a/include/trace/trace_events.h
+++ b/include/trace/trace_events.h
@@ -283,8 +283,16 @@ TRACE_MAKE_SYSTEM_STR();
trace_print_symbols_seq(p, value, symbols); \
})
+#undef __print_flags_u64
#undef __print_symbolic_u64
#if BITS_PER_LONG == 32
+#define __print_flags_u64(flag, delim, flag_array...) \
+ ({ \
+ static const struct trace_print_flags_u64 __flags[] = \
+ { flag_array, { -1, NULL } }; \
+ trace_print_flags_seq_u64(p, delim, flag, __flags); \
+ })
+
#define __print_symbolic_u64(value, symbol_array...) \
({ \
static const struct trace_print_flags_u64 symbols[] = \
@@ -292,6 +300,9 @@ TRACE_MAKE_SYSTEM_STR();
trace_print_symbols_seq_u64(p, value, symbols); \
})
#else
+#define __print_flags_u64(flag, delim, flag_array...) \
+ __print_flags(flag, delim, flag_array)
+
#define __print_symbolic_u64(value, symbol_array...) \
__print_symbolic(value, symbol_array)
#endif
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index 3fc2042..69045b7 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -124,6 +124,44 @@ EXPORT_SYMBOL(trace_print_symbols_seq);
#if BITS_PER_LONG == 32
const char *
+trace_print_flags_seq_u64(struct trace_seq *p, const char *delim,
+ unsigned long long flags,
+ const struct trace_print_flags_u64 *flag_array)
+{
+ unsigned long long mask;
+ const char *str;
+ const char *ret = trace_seq_buffer_ptr(p);
+ int i, first = 1;
+
+ for (i = 0; flag_array[i].name && flags; i++) {
+
+ mask = flag_array[i].mask;
+ if ((flags & mask) != mask)
+ continue;
+
+ str = flag_array[i].name;
+ flags &= ~mask;
+ if (!first && delim)
+ trace_seq_puts(p, delim);
+ else
+ first = 0;
+ trace_seq_puts(p, str);
+ }
+
+ /* check for left over flags */
+ if (flags) {
+ if (!first && delim)
+ trace_seq_puts(p, delim);
+ trace_seq_printf(p, "0x%llx", flags);
+ }
+
+ trace_seq_putc(p, 0);
+
+ return ret;
+}
+EXPORT_SYMBOL(trace_print_flags_seq_u64);
+
+const char *
trace_print_symbols_seq_u64(struct trace_seq *p, unsigned long long val,
const struct trace_print_flags_u64 *symbol_array)
{
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Steven Rostedt <rostedt@goodmis.org> |
|---|---|
| Date | 2016-12-01 18:00 +0100 |
| Subject | Re: [PATCH v3 1/5] tracing: add __print_flags_u64() |
| Message-ID | <sJCSe-6Dp-19@gated-at.bofh.it> |
| In reply to | #1534269 |
On Thu, 1 Dec 2016 09:37:47 -0700 Ross Zwisler <ross.zwisler@linux.intel.com> wrote: > Add __print_flags_u64() and the helper trace_print_flags_seq_u64() in the > same spirit as __print_symbolic_u64() and trace_print_symbols_seq_u64(). > These functions allow us to print symbols associated with flags that are 64 > bits wide even on 32 bit machines. > > These will be used by the DAX code so that we can print the flags set in a > pfn_t such as PFN_SG_CHAIN, PFN_SG_LAST, PFN_DEV and PFN_MAP. > > Without this new function I was getting errors like the following when > compiling for i386: > > ./include/linux/pfn_t.h:13:22: warning: large integer implicitly truncated > to unsigned type [-Woverflow] > #define PFN_SG_CHAIN (1ULL << (BITS_PER_LONG_LONG - 1)) > ^ > > Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com> Reviewed-by: Steven Rostedt <rostedt@goodmis.org> -- Steve
[toc] | [prev] | [next] | [standalone]
| From | Ross Zwisler <ross.zwisler@linux.intel.com> |
|---|---|
| Date | 2016-12-01 17:40 +0100 |
| Subject | [PATCH v3 4/5] dax: add tracepoints to dax_pmd_load_hole() |
| Message-ID | <sJCyS-6te-33@gated-at.bofh.it> |
| In reply to | #1534266 |
Add tracepoints to dax_pmd_load_hole(), following the same logging
conventions as the tracepoints in dax_iomap_pmd_fault().
Here is an example PMD fault showing the new tracepoints:
read_big-1478 [004] .... 238.242188: xfs_filemap_pmd_fault: dev 259:0
ino 0x1003
read_big-1478 [004] .... 238.242191: dax_pmd_fault: dev 259:0 ino 0x1003
shared ALLOW_RETRY|KILLABLE|USER address 0x10400000 vm_start 0x10200000
vm_end 0x10600000 pgoff 0x200 max_pgoff 0x1400
read_big-1478 [004] .... 238.242390: dax_pmd_load_hole: dev 259:0 ino
0x1003 shared address 0x10400000 zero_page ffffea0002c20000 radix_entry
0x1e
read_big-1478 [004] .... 238.242392: dax_pmd_fault_done: dev 259:0 ino
0x1003 shared ALLOW_RETRY|KILLABLE|USER address 0x10400000 vm_start
0x10200000 vm_end 0x10600000 pgoff 0x200 max_pgoff 0x1400 NOPAGE
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Jan Kara <jack@suse.cz>
---
fs/dax.c | 14 ++++++++++----
include/trace/events/fs_dax.h | 42 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 52 insertions(+), 4 deletions(-)
diff --git a/fs/dax.c b/fs/dax.c
index 360995a..61b3080 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -1269,33 +1269,39 @@ static int dax_pmd_load_hole(struct vm_area_struct *vma, pmd_t *pmd,
{
struct address_space *mapping = vma->vm_file->f_mapping;
unsigned long pmd_addr = address & PMD_MASK;
+ struct inode *inode = mapping->host;
struct page *zero_page;
+ void *ret = NULL;
spinlock_t *ptl;
pmd_t pmd_entry;
- void *ret;
zero_page = mm_get_huge_zero_page(vma->vm_mm);
if (unlikely(!zero_page))
- return VM_FAULT_FALLBACK;
+ goto fallback;
ret = dax_insert_mapping_entry(mapping, vmf, *entryp, 0,
RADIX_DAX_PMD | RADIX_DAX_HZP);
if (IS_ERR(ret))
- return VM_FAULT_FALLBACK;
+ goto fallback;
*entryp = ret;
ptl = pmd_lock(vma->vm_mm, pmd);
if (!pmd_none(*pmd)) {
spin_unlock(ptl);
- return VM_FAULT_FALLBACK;
+ goto fallback;
}
pmd_entry = mk_pmd(zero_page, vma->vm_page_prot);
pmd_entry = pmd_mkhuge(pmd_entry);
set_pmd_at(vma->vm_mm, pmd_addr, pmd, pmd_entry);
spin_unlock(ptl);
+ trace_dax_pmd_load_hole(inode, vma, address, zero_page, ret);
return VM_FAULT_NOPAGE;
+
+fallback:
+ trace_dax_pmd_load_hole_fallback(inode, vma, address, zero_page, ret);
+ return VM_FAULT_FALLBACK;
}
int dax_iomap_pmd_fault(struct vm_area_struct *vma, unsigned long address,
diff --git a/include/trace/events/fs_dax.h b/include/trace/events/fs_dax.h
index 58b0b56..43f1263 100644
--- a/include/trace/events/fs_dax.h
+++ b/include/trace/events/fs_dax.h
@@ -61,6 +61,48 @@ DEFINE_EVENT(dax_pmd_fault_class, name, \
DEFINE_PMD_FAULT_EVENT(dax_pmd_fault);
DEFINE_PMD_FAULT_EVENT(dax_pmd_fault_done);
+DECLARE_EVENT_CLASS(dax_pmd_load_hole_class,
+ TP_PROTO(struct inode *inode, struct vm_area_struct *vma,
+ unsigned long address, struct page *zero_page,
+ void *radix_entry),
+ TP_ARGS(inode, vma, address, zero_page, radix_entry),
+ TP_STRUCT__entry(
+ __field(unsigned long, ino)
+ __field(unsigned long, vm_flags)
+ __field(unsigned long, address)
+ __field(struct page *, zero_page)
+ __field(void *, radix_entry)
+ __field(dev_t, dev)
+ ),
+ TP_fast_assign(
+ __entry->dev = inode->i_sb->s_dev;
+ __entry->ino = inode->i_ino;
+ __entry->vm_flags = vma->vm_flags;
+ __entry->address = address;
+ __entry->zero_page = zero_page;
+ __entry->radix_entry = radix_entry;
+ ),
+ TP_printk("dev %d:%d ino %#lx %s address %#lx zero_page %p "
+ "radix_entry %#lx",
+ MAJOR(__entry->dev),
+ MINOR(__entry->dev),
+ __entry->ino,
+ __entry->vm_flags & VM_SHARED ? "shared" : "private",
+ __entry->address,
+ __entry->zero_page,
+ (unsigned long)__entry->radix_entry
+ )
+)
+
+#define DEFINE_PMD_LOAD_HOLE_EVENT(name) \
+DEFINE_EVENT(dax_pmd_load_hole_class, name, \
+ TP_PROTO(struct inode *inode, struct vm_area_struct *vma, \
+ unsigned long address, struct page *zero_page, \
+ void *radix_entry), \
+ TP_ARGS(inode, vma, address, zero_page, radix_entry))
+
+DEFINE_PMD_LOAD_HOLE_EVENT(dax_pmd_load_hole);
+DEFINE_PMD_LOAD_HOLE_EVENT(dax_pmd_load_hole_fallback);
#endif /* _TRACE_FS_DAX_H */
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Steven Rostedt <rostedt@goodmis.org> |
|---|---|
| Date | 2016-12-01 18:00 +0100 |
| Subject | Re: [PATCH v3 4/5] dax: add tracepoints to dax_pmd_load_hole() |
| Message-ID | <sJCSe-6Dp-23@gated-at.bofh.it> |
| In reply to | #1534273 |
On Thu, 1 Dec 2016 09:37:50 -0700 Ross Zwisler <ross.zwisler@linux.intel.com> wrote: > Add tracepoints to dax_pmd_load_hole(), following the same logging > conventions as the tracepoints in dax_iomap_pmd_fault(). > > Here is an example PMD fault showing the new tracepoints: > > read_big-1478 [004] .... 238.242188: xfs_filemap_pmd_fault: dev 259:0 > ino 0x1003 > > read_big-1478 [004] .... 238.242191: dax_pmd_fault: dev 259:0 ino 0x1003 > shared ALLOW_RETRY|KILLABLE|USER address 0x10400000 vm_start 0x10200000 > vm_end 0x10600000 pgoff 0x200 max_pgoff 0x1400 > > read_big-1478 [004] .... 238.242390: dax_pmd_load_hole: dev 259:0 ino > 0x1003 shared address 0x10400000 zero_page ffffea0002c20000 radix_entry > 0x1e > > read_big-1478 [004] .... 238.242392: dax_pmd_fault_done: dev 259:0 ino > 0x1003 shared ALLOW_RETRY|KILLABLE|USER address 0x10400000 vm_start > 0x10200000 vm_end 0x10600000 pgoff 0x200 max_pgoff 0x1400 NOPAGE > > Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com> > Reviewed-by: Jan Kara <jack@suse.cz> > --- Acked-by: Steven Rostedt <rostedt@goodmis.org> -- Steve
[toc] | [prev] | [next] | [standalone]
| From | Ross Zwisler <ross.zwisler@linux.intel.com> |
|---|---|
| Date | 2016-12-01 17:40 +0100 |
| Subject | [PATCH v3 5/5] dax: add tracepoints to dax_pmd_insert_mapping() |
| Message-ID | <sJCyS-6te-27@gated-at.bofh.it> |
| In reply to | #1534266 |
Add tracepoints to dax_pmd_insert_mapping(), following the same logging
conventions as the tracepoints in dax_iomap_pmd_fault().
Here is an example PMD fault showing the new tracepoints:
big-1504 [001] .... 326.960743: xfs_filemap_pmd_fault: dev 259:0 ino
0x1003
big-1504 [001] .... 326.960753: dax_pmd_fault: dev 259:0 ino 0x1003
shared WRITE|ALLOW_RETRY|KILLABLE|USER address 0x10505000 vm_start
0x10200000 vm_end 0x10700000 pgoff 0x200 max_pgoff 0x1400
big-1504 [001] .... 326.960981: dax_pmd_insert_mapping: dev 259:0 ino
0x1003 shared write address 0x10505000 length 0x200000 pfn 0x100600 DEV|MAP
radix_entry 0xc000e
big-1504 [001] .... 326.960986: dax_pmd_fault_done: dev 259:0 ino 0x1003
shared WRITE|ALLOW_RETRY|KILLABLE|USER address 0x10505000 vm_start
0x10200000 vm_end 0x10700000 pgoff 0x200 max_pgoff 0x1400 NOPAGE
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Jan Kara <jack@suse.cz>
---
fs/dax.c | 12 +++++++---
include/linux/pfn_t.h | 6 +++++
include/trace/events/fs_dax.h | 51 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 66 insertions(+), 3 deletions(-)
diff --git a/fs/dax.c b/fs/dax.c
index 61b3080..d3fe880 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -1232,15 +1232,16 @@ static int dax_pmd_insert_mapping(struct vm_area_struct *vma, pmd_t *pmd,
{
struct address_space *mapping = vma->vm_file->f_mapping;
struct block_device *bdev = iomap->bdev;
+ struct inode *inode = mapping->host;
struct blk_dax_ctl dax = {
.sector = dax_iomap_sector(iomap, pos),
.size = PMD_SIZE,
};
long length = dax_map_atomic(bdev, &dax);
- void *ret;
+ void *ret = NULL;
if (length < 0) /* dax_map_atomic() failed */
- return VM_FAULT_FALLBACK;
+ goto fallback;
if (length < PMD_SIZE)
goto unmap_fallback;
if (pfn_t_to_pfn(dax.pfn) & PG_PMD_COLOUR)
@@ -1253,13 +1254,18 @@ static int dax_pmd_insert_mapping(struct vm_area_struct *vma, pmd_t *pmd,
ret = dax_insert_mapping_entry(mapping, vmf, *entryp, dax.sector,
RADIX_DAX_PMD);
if (IS_ERR(ret))
- return VM_FAULT_FALLBACK;
+ goto fallback;
*entryp = ret;
+ trace_dax_pmd_insert_mapping(inode, vma, address, write, length,
+ dax.pfn, ret);
return vmf_insert_pfn_pmd(vma, address, pmd, dax.pfn, write);
unmap_fallback:
dax_unmap_atomic(bdev, &dax);
+fallback:
+ trace_dax_pmd_insert_mapping_fallback(inode, vma, address, write,
+ length, dax.pfn, ret);
return VM_FAULT_FALLBACK;
}
diff --git a/include/linux/pfn_t.h b/include/linux/pfn_t.h
index a3d90b9..033fc7b 100644
--- a/include/linux/pfn_t.h
+++ b/include/linux/pfn_t.h
@@ -15,6 +15,12 @@
#define PFN_DEV (1ULL << (BITS_PER_LONG_LONG - 3))
#define PFN_MAP (1ULL << (BITS_PER_LONG_LONG - 4))
+#define PFN_FLAGS_TRACE \
+ { PFN_SG_CHAIN, "SG_CHAIN" }, \
+ { PFN_SG_LAST, "SG_LAST" }, \
+ { PFN_DEV, "DEV" }, \
+ { PFN_MAP, "MAP" }
+
static inline pfn_t __pfn_to_pfn_t(unsigned long pfn, u64 flags)
{
pfn_t pfn_t = { .val = pfn | (flags & PFN_FLAGS_MASK), };
diff --git a/include/trace/events/fs_dax.h b/include/trace/events/fs_dax.h
index 43f1263..c3b0aae 100644
--- a/include/trace/events/fs_dax.h
+++ b/include/trace/events/fs_dax.h
@@ -104,6 +104,57 @@ DEFINE_EVENT(dax_pmd_load_hole_class, name, \
DEFINE_PMD_LOAD_HOLE_EVENT(dax_pmd_load_hole);
DEFINE_PMD_LOAD_HOLE_EVENT(dax_pmd_load_hole_fallback);
+DECLARE_EVENT_CLASS(dax_pmd_insert_mapping_class,
+ TP_PROTO(struct inode *inode, struct vm_area_struct *vma,
+ unsigned long address, int write, long length, pfn_t pfn,
+ void *radix_entry),
+ TP_ARGS(inode, vma, address, write, length, pfn, radix_entry),
+ TP_STRUCT__entry(
+ __field(unsigned long, ino)
+ __field(unsigned long, vm_flags)
+ __field(unsigned long, address)
+ __field(long, length)
+ __field(u64, pfn_val)
+ __field(void *, radix_entry)
+ __field(dev_t, dev)
+ __field(int, write)
+ ),
+ TP_fast_assign(
+ __entry->dev = inode->i_sb->s_dev;
+ __entry->ino = inode->i_ino;
+ __entry->vm_flags = vma->vm_flags;
+ __entry->address = address;
+ __entry->write = write;
+ __entry->length = length;
+ __entry->pfn_val = pfn.val;
+ __entry->radix_entry = radix_entry;
+ ),
+ TP_printk("dev %d:%d ino %#lx %s %s address %#lx length %#lx "
+ "pfn %#llx %s radix_entry %#lx",
+ MAJOR(__entry->dev),
+ MINOR(__entry->dev),
+ __entry->ino,
+ __entry->vm_flags & VM_SHARED ? "shared" : "private",
+ __entry->write ? "write" : "read",
+ __entry->address,
+ __entry->length,
+ __entry->pfn_val & ~PFN_FLAGS_MASK,
+ __print_flags_u64(__entry->pfn_val & PFN_FLAGS_MASK, "|",
+ PFN_FLAGS_TRACE),
+ (unsigned long)__entry->radix_entry
+ )
+)
+
+#define DEFINE_PMD_INSERT_MAPPING_EVENT(name) \
+DEFINE_EVENT(dax_pmd_insert_mapping_class, name, \
+ TP_PROTO(struct inode *inode, struct vm_area_struct *vma, \
+ unsigned long address, int write, long length, pfn_t pfn, \
+ void *radix_entry), \
+ TP_ARGS(inode, vma, address, write, length, pfn, radix_entry))
+
+DEFINE_PMD_INSERT_MAPPING_EVENT(dax_pmd_insert_mapping);
+DEFINE_PMD_INSERT_MAPPING_EVENT(dax_pmd_insert_mapping_fallback);
+
#endif /* _TRACE_FS_DAX_H */
/* This part must be outside protection */
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Steven Rostedt <rostedt@goodmis.org> |
|---|---|
| Date | 2016-12-01 18:00 +0100 |
| Subject | Re: [PATCH v3 5/5] dax: add tracepoints to dax_pmd_insert_mapping() |
| Message-ID | <sJCSe-6Dp-25@gated-at.bofh.it> |
| In reply to | #1534274 |
On Thu, 1 Dec 2016 09:37:51 -0700 Ross Zwisler <ross.zwisler@linux.intel.com> wrote: > Add tracepoints to dax_pmd_insert_mapping(), following the same logging > conventions as the tracepoints in dax_iomap_pmd_fault(). > > Here is an example PMD fault showing the new tracepoints: > > big-1504 [001] .... 326.960743: xfs_filemap_pmd_fault: dev 259:0 ino > 0x1003 > > big-1504 [001] .... 326.960753: dax_pmd_fault: dev 259:0 ino 0x1003 > shared WRITE|ALLOW_RETRY|KILLABLE|USER address 0x10505000 vm_start > 0x10200000 vm_end 0x10700000 pgoff 0x200 max_pgoff 0x1400 > > big-1504 [001] .... 326.960981: dax_pmd_insert_mapping: dev 259:0 ino > 0x1003 shared write address 0x10505000 length 0x200000 pfn 0x100600 DEV|MAP > radix_entry 0xc000e > > big-1504 [001] .... 326.960986: dax_pmd_fault_done: dev 259:0 ino 0x1003 > shared WRITE|ALLOW_RETRY|KILLABLE|USER address 0x10505000 vm_start > 0x10200000 vm_end 0x10700000 pgoff 0x200 max_pgoff 0x1400 NOPAGE > > Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com> > Reviewed-by: Jan Kara <jack@suse.cz> > --- Acked-by: Steven Rostedt <rostedt@goodmis.org> -- Steve
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web