Skip to content

ZIL fixes #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions bpf/standalone/zil.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,15 @@
import argparse
import sys
import os
repo_lib_dir = os.path.dirname(__file__) + "/../../lib/"
if os.path.exists(repo_lib_dir + "bcchelper.py"):
sys.path.append(repo_lib_dir)
else:
sys.path.append("/usr/share/performance-diagnostics/lib/")
from bcchelper import BCCHelper # noqa
base_dir = os.path.dirname(__file__) + "/../../"
if not os.path.exists(base_dir + "lib/bcchelper.py"):
base_dir = "/usr/share/performance-diagnostics/"
sys.path.append(base_dir + 'lib/')
from bcchelper import BCCHelper # noqa: E402

# define BPF program
bpf_text = """
#include "/opt/delphix/server/etc/bcc_helper.h"
bpf_text = '#include "' + base_dir + 'lib/bcc_helper.h' + '"\n'
bpf_text += """
#include <uapi/linux/ptrace.h>
#include <linux/bpf_common.h>
#include <uapi/linux/bpf.h>
Expand Down Expand Up @@ -132,7 +131,7 @@
return 0;

info.alloc_count = 0;
info.sync = ioflag & (FSYNC | FDSYNC) ||
info.sync = ioflag & (O_SYNC | O_DSYNC) ||
zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS;
zil_info_map.update(&tid, &info);
return 0;
Expand Down