From 327ced8942114c540d6cced1b0ff96b3074f6f1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elek=20M=C3=A1rton?= Date: Mon, 10 Aug 2020 15:04:57 +0200 Subject: [PATCH 1/2] HDDS-4095. Byteman script to debug HCFS performance --- dev-support/byteman/hcfs-write.btm | 111 +++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 dev-support/byteman/hcfs-write.btm diff --git a/dev-support/byteman/hcfs-write.btm b/dev-support/byteman/hcfs-write.btm new file mode 100644 index 000000000000..8e8373d532ce --- /dev/null +++ b/dev-support/byteman/hcfs-write.btm @@ -0,0 +1,111 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +RULE FileSystem.close +CLASS org.apache.hadoop.fs.FileSystem +METHOD close +IF TRUE +DO + System.out.println("Closing file system instance: " + System.identityHashCode($0)); + System.out.println(" write.call: " + readCounter("write.call")); + System.out.println(" write.allTime: " + readCounter("write.allTime")); + System.out.println(" hsync.call: " + readCounter("hsync.call")); + System.out.println(" hsync.allTime: " + readCounter("hsync.allTime")); + System.out.println(" hflush.call: " + readCounter("hflush.call")); + System.out.println(" hflush.allTime: " + readCounter("hflush.allTime")); + System.out.println(" close.call: " + readCounter("close.call")); + System.out.println(" close.allTime: " + readCounter("close.allTime")) + + +ENDRULE + +RULE DataOutputStream.Write.Entry +CLASS ^FSDataOutputStream$PositionCache +METHOD write +AT ENTRY +IF TRUE +DO resetTimer(Thread.currentThread()); + incrementCounter("write.call") +ENDRULE + +RULE DataOutputStream.Write.Exit +CLASS ^FSDataOutputStream$PositionCache +METHOD write +AT EXIT +BIND elapsedTime = java.lang.Math.toIntExact(getElapsedTimeFromTimer(Thread.currentThread())) +IF TRUE +DO + incrementCounter("write.allTime", elapsedTime) +ENDRULE + + +RULE FSDataOutputStream.Hsync.Entry +CLASS FSDataOutputStream +METHOD hsync +AT ENTRY +IF TRUE +DO resetTimer(Thread.currentThread()); + incrementCounter("hsync.call") +ENDRULE + +RULE FSDataOutputStream.Hsync.Exit +CLASS FSDataOutputStream +METHOD hsync +AT EXIT +BIND elapsedTime = java.lang.Math.toIntExact(getElapsedTimeFromTimer(Thread.currentThread())) +IF TRUE +DO + incrementCounter("hsync.allTime", elapsedTime) +ENDRULE + + +RULE FSDataOutputStream.Hflush.Entry +CLASS ^FSDataOutputStream +METHOD hflush +AT ENTRY +IF TRUE +DO resetTimer(Thread.currentThread()); + incrementCounter("hflush.call") +ENDRULE + +RULE FSDataOutputStream.Hflush.Exit +CLASS ^FSDataOutputStream +METHOD hflush +AT EXIT +BIND elapsedTime = java.lang.Math.toIntExact(getElapsedTimeFromTimer(Thread.currentThread())) +IF TRUE +DO + incrementCounter("hflush.allTime", elapsedTime) +ENDRULE + + +RULE FSDataOutputStream.Close.Entry +CLASS ^FSDataOutputStream +METHOD close +AT ENTRY +IF TRUE +DO resetTimer(Thread.currentThread()); + incrementCounter("close.call") +ENDRULE + +RULE FSDataOutputStream.Close.Exit +CLASS ^FSDataOutputStream +METHOD close +AT EXIT +BIND elapsedTime = java.lang.Math.toIntExact(getElapsedTimeFromTimer(Thread.currentThread())) +IF TRUE +DO + incrementCounter("close.allTime", elapsedTime) +ENDRULE From fb96d371b70e4e55faa086f20b54bde44a5aec3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elek=20M=C3=A1rton?= Date: Tue, 11 Aug 2020 15:38:11 +0200 Subject: [PATCH 2/2] retrigger build with empty commit