Skip to content

Commit

Permalink
dependency commit
Browse files Browse the repository at this point in the history
  • Loading branch information
aman-1004 committed Jul 19, 2023
1 parent ee5346a commit 6e46116
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 2 deletions.
8 changes: 8 additions & 0 deletions NfsDiagnostics/nfsclientlogs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ TRACE_NFSBPF_ABS_PATH="/opt/xstore/lib/NfsDiagnostics/trace-nfsbpf"
PYTHON_PROG='python'
STDLOG_FILE='/dev/null'


# to enable backward compatibility.
_trace_nfsfsbpf_alt_path="$(cd "$(dirname "trace-nfsbpf")" && pwd)/$(basename "trace-nfsbpf")"
if [[ -f "${_trace_nfsbpf_alt_path}" ]];
then
TRACE_NFSBPF_ABS_PATH="${_trace_nfsbpf_alt_path}"
fi

main() {
if [[ "$*" =~ "v3b" ]]
then
Expand Down
9 changes: 8 additions & 1 deletion SMBDiagnostics/smbclientlogs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ PYTHON_PROG='python'
STDLOG_FILE='/dev/null'


# to enable backward compatibility.
_trace_cifsbpf_alt_path="$(cd "$(dirname "trace-cifsbpf")" && pwd)/$(basename "trace-cifsbpf")"
if [[ -f "${_trace_cifsbpf_alt_path}" ]];
then
TRACE_CIFSBPF_ABS_PATH="${_trace_cifsbpf_alt_path}"
fi

main() {
if [[ "$*" =~ "start" ]]
then
Expand Down Expand Up @@ -118,7 +125,7 @@ capture_network() {
}

trace_cifsbpf() {
/usr/bin/env "${PYTHON_PROG}" "${TRACE_CIFSBPF_ABS_PATH}" "${DIRNAME}" 0<&- 2>&1 &
nohup /usr/bin/env "${PYTHON_PROG}" "${TRACE_CIFSBPF_ABS_PATH}" "${DIRNAME}" 0<&- 2>&1 &
}

stop() {
Expand Down
3 changes: 2 additions & 1 deletion diag-main.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/bash

PACKAGE_TREE="$(dirname $(dirname $(readlink -f $0)))"
# PACKAGE_TREE="$(dirname $(dirname $(readlink -f $0)))"
PACKAGE_TREE="/opt/xstore"
run() {
if [[ $1 == "nfs" ]] || [[ $1 == "cifs" ]];
then
Expand Down
1 change: 1 addition & 0 deletions packaging/DEBIAN/control
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ Version: $VERSION
Maintainer: Microsoft
Architecture: all
Description: Diagnostics scripts for CIFS and NFS.
Depends: tcpdump, trace-cmd, rpcdebug
1 change: 1 addition & 0 deletions packaging/DEBIAN/preinst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
apt-get -y install bpfcc-tools linux-headers-$(uname -r)
5 changes: 5 additions & 0 deletions packaging/RPM/spec.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ Summary: Diagnostics scripts for NFS and CIFS
License: GPL
URL: https://example.com

Requires: tcpdump
Requires: trace-cmd
Requires: rpcdebug

%description
Diagnostics scripts for NFS and CIFS

%prep
dnf install -y bcc

%install
# Install script and related files
Expand Down

0 comments on commit 6e46116

Please sign in to comment.