{"id":2448,"date":"2019-01-27T00:26:11","date_gmt":"2019-01-26T21:26:11","guid":{"rendered":"https:\/\/gokhan-gokalp.com\/?p=2448"},"modified":"2019-02-18T11:39:53","modified_gmt":"2019-02-18T08:39:53","slug":"overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng","status":"publish","type":"post","link":"https:\/\/gokhan-gokalp.com\/tr\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\/","title":{"rendered":".NET Core Uygulamalar\u0131n\u0131n Linux \u00dczerinde Debugging &#038; Profiling \u0130\u015flemlerine Genel Bak\u0131\u015f &#8211; 1 (Perf, LTTNg)"},"content":{"rendered":"<p>Genelde hayat\u0131m\u0131zdaki b\u00fct\u00fcn i\u015flerin, her zaman iyi bir \u015fekilde yolunda gitmesini bekleriz\/isteriz. (Asl\u0131nda kim beklemez ki?) Maalesef bir \u00e7ok zaman ise, i\u015fler bekledi\u011fimiz, planlad\u0131\u011f\u0131m\u0131z veya umdu\u011fumuz gibi olmuyor, iyi bir \u015fekilde yolunda gitmiyor.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2019\/01\/unexcepted.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-2451 lazyload\" data-src=\"\/wp-content\/uploads\/2019\/01\/unexcepted.jpg\" alt=\"\" width=\"750\" height=\"500\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/unexcepted.jpg 750w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/unexcepted-300x200.jpg 300w\" data-sizes=\"(max-width: 750px) 100vw, 750px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 750px; --smush-placeholder-aspect-ratio: 750\/500;\" \/><\/a><\/p>\n<p>Bir developer olarak beklentilerimiz, hayat\u0131m\u0131zda oldu\u011fu gibi, geli\u015ftirdi\u011fimiz uygulamalarda da asl\u0131nda her \u015feyin iyi bir \u015fekilde yolunda gitmesinden yana. Geli\u015ftirdi\u011fimiz uygulamalar\u0131n gerek functional \u00f6zelliklerinin sorunsuz (<strong>bug<\/strong>&#8216;s\u0131z) ve m\u00fc\u015fterinin istedi\u011fi gibi \u00e7al\u0131\u015fabilmesi, gerekse de iyi bir \u015fekilde non-functional \u00f6zelliklere sahip olabilmesini isteriz. \u00d6rne\u011fin <strong>performans<\/strong> kriteri.<\/p>\n<p>Performans kriteri bir \u00e7ok zaman kullan\u0131c\u0131lar\u0131 bizim sistemimizde tutabilmemizi sa\u011flayan \u00f6nemli bir \u015feydir asl\u0131nda. D\u00fc\u015f\u00fcnsenize bir e-ticaret sitesinden al\u0131\u015fveri\u015f yapaca\u011f\u0131z ve bir \u015feyler yolunda gitmiyor. \u00dcr\u00fcnler sepete eklenmiyor ve response&#8217;lar \u00e7ok ge\u00e7 geliyor. Son kullan\u0131c\u0131 g\u00f6z\u00fcnden bakarsak, ne kadar da s\u0131k\u0131c\u0131 bir durum de\u011fil mi?<\/p>\n<p><a href=\"\/wp-content\/uploads\/2019\/01\/loading-response.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-2463 lazyload\" data-src=\"\/wp-content\/uploads\/2019\/01\/loading-response.png\" alt=\"\" width=\"1594\" height=\"766\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/loading-response.png 1594w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/loading-response-300x144.png 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/loading-response-768x369.png 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/loading-response-1024x492.png 1024w\" data-sizes=\"(max-width: 1594px) 100vw, 1594px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1594px; --smush-placeholder-aspect-ratio: 1594\/766;\" \/><\/a><\/p>\n<p>Uygulamam\u0131z \u00e7ok g\u00fczel olabilir fakat performans kriterinin etkileri, uygulamaya k\u00f6t\u00fc bir \u015fekilde yans\u0131yacakt\u0131r.<\/p>\n<p>Biz developer&#8217;lara ise burada b\u00fcy\u00fck bir i\u015f d\u00fc\u015f\u00fcyor. \u0130yi performansa sahip bir uygulama geli\u015ftirmek veya iyile\u015ftirmek istiyorsak, uygulamam\u0131z\u0131n hangi par\u00e7as\u0131n\u0131n bottleneck&#8217;e d\u00fc\u015ft\u00fc\u011f\u00fcn\u00fc biliyor olmal\u0131y\u0131z ki o noktaya odaklanabilelim.<\/p>\n<p>Her neyse diyece\u011fim o ki, &#8220;yaz\u0131l\u0131m geli\u015ftirme&#8221; sadece &#8220;programlamadan&#8221; ibaret de\u011fil. Programlamadan daha fazlas\u0131. Geli\u015ftirdi\u011fimiz bir uygulama her zaman bekledi\u011fimiz gibi davranmayabilir. Beklenmedik zamanlarda performans problemleri ya\u015fanabilir veya insan fakt\u00f6r\u00fcnden kaynakl\u0131 bug&#8217;lar meydana gelebilir. San\u0131r\u0131m buradaki as\u0131l nokta ise, ka\u00e7\u0131n\u0131lmaz olan bu ger\u00e7ekler kar\u015f\u0131s\u0131nda nas\u0131l ayakta durabilece\u011fimiz ve \u00fcstesinden nas\u0131l gelebilece\u011fimizdir.<\/p>\n<blockquote><p>Bu arada &#8220;beklenmedik zamanlar\u0131n&#8221; i\u015fe yarad\u0131\u011f\u0131 farkl\u0131 konular da var elbette.<\/p><\/blockquote>\n<p><a href=\"\/wp-content\/uploads\/2019\/01\/quote-the-key-to-a-woman-s-heart-is-an-unexpected-gift-at-an-unexpected-time-sean-connery-86-95-44.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-2457 lazyload\" data-src=\"\/wp-content\/uploads\/2019\/01\/quote-the-key-to-a-woman-s-heart-is-an-unexpected-gift-at-an-unexpected-time-sean-connery-86-95-44.jpg\" alt=\"\" width=\"850\" height=\"400\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/quote-the-key-to-a-woman-s-heart-is-an-unexpected-gift-at-an-unexpected-time-sean-connery-86-95-44.jpg 850w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/quote-the-key-to-a-woman-s-heart-is-an-unexpected-gift-at-an-unexpected-time-sean-connery-86-95-44-300x141.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/quote-the-key-to-a-woman-s-heart-is-an-unexpected-gift-at-an-unexpected-time-sean-connery-86-95-44-768x361.jpg 768w\" data-sizes=\"(max-width: 850px) 100vw, 850px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 850px; --smush-placeholder-aspect-ratio: 850\/400;\" \/><\/a><\/p>\n<p>Asl\u0131nda konuyu ba\u011flamak istedi\u011fim nokta ise, <strong><em>Grace Hopper<\/em><\/strong>&#8216;\u0131nda terimlerinde \u00f6nc\u00fcl\u00fck etti\u011fi &#8220;<strong>bug<\/strong>&#8221; ve &#8220;<strong>debugging<\/strong>&#8221; i\u015flemleri.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2019\/01\/bug_orig.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-2455 lazyload\" data-src=\"\/wp-content\/uploads\/2019\/01\/bug_orig.jpg\" alt=\"\" width=\"1000\" height=\"315\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/bug_orig.jpg 1000w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/bug_orig-300x95.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/bug_orig-768x242.jpg 768w\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1000px; --smush-placeholder-aspect-ratio: 1000\/315;\" \/><\/a><\/p>\n<p>\u00d6zellikle &#8220;<em>debugging<\/em>&#8221; ve &#8220;<em>profiling<\/em>&#8221; i\u015flemlerini runtime \u00fczerinde ger\u00e7ekle\u015ftirmek s\u00f6z konusu olunca, san\u0131r\u0131m as\u0131l <strong>challenge<\/strong> ozaman bizim i\u00e7in ba\u015fl\u0131yor.<\/p>\n<p>Bu makale kapsam\u0131nda ise daha \u00f6nce &#8220;<a href=\"https:\/\/gokhan-gokalp.com\/en\/dotnet-reconnect-etkinligi-debugging-and-profiling-net-core-applications-on-linux\/\" target=\"_blank\" rel=\"noopener\"><em>dotnet reconnect()<\/em><\/a>&#8221; etkinli\u011finde de konu\u015fmac\u0131 olarak anlatm\u0131\u015f oldu\u011fum,\u00a0<em>.NET Core<\/em> ile geli\u015ftirmi\u015f oldu\u011fumuz uygulamalar\u0131n linux \u00fczerindeki debugging ve profiling i\u015flemlerini nas\u0131l ger\u00e7ekle\u015ftirebiliriz konusuna bir ka\u00e7 \u00f6rnek use-case ile iki farkl\u0131 makale serisi olarak genel bir bak\u0131\u015f atmaya \u00e7al\u0131\u015faca\u011f\u0131z.<\/p>\n<p>Makale serisi boyunca debugging ve profiling i\u015flemleri s\u0131ras\u0131nda, &#8220;<em>Perf<\/em>&#8220;, &#8220;<em>LTTng<\/em>&#8221; &#8220;<em>gcore<\/em>&#8220;, &#8220;FlameGraph&#8221; ve &#8220;<em>LLDB<\/em>&#8221; gibi tool&#8217;lardan yararlan\u0131yor olaca\u011f\u0131z. Bu 1. makale serisinde ise, &#8220;<em>sampling<\/em>&#8221; ve &#8220;<em>tracing<\/em>&#8221; kavramlar\u0131na bir giri\u015f yapaca\u011f\u0131z ve <em>perf<\/em>\u00a0tool&#8217;u ile bir profiling i\u015flemi ard\u0131ndan <em>lttng<\/em>\u00a0tool&#8217;u ile de bir tracing i\u015flemi ger\u00e7ekle\u015ftirece\u011fiz.<\/p>\n<blockquote><p><strong>NOT<\/strong>: Makale boyunca, windows ortam\u0131nda bu tarz i\u015flere yabanc\u0131 olmad\u0131\u011f\u0131n\u0131z varsay\u0131m\u0131yla ilerliyor olaca\u011f\u0131m.<\/p><\/blockquote>\n<h2>Sampling &amp; Tracing<\/h2>\n<p><em>Debugging &amp; Profiling i\u015flemlerine ba\u015flamadan \u00f6nce, iki farkl\u0131 kavramdan bahsetmek istiyorum. CPU<\/em> \u00f6l\u00e7\u00fcm\u00fc s\u00f6z konusu oldu\u011funda, iki farkl\u0131 measurement mode&#8217;una sahibiz. Bunlardan birisi <strong>sampling<\/strong>, bir di\u011feri ise <strong>tracing<\/strong>&#8216;dir.<\/p>\n<h3>Sampling<\/h3>\n<p>Sampling tercih edildi\u011finde, profiler periyodik olarak ilgili kodun yava\u015f \u00e7al\u0131\u015fan k\u0131s\u0131mlar\u0131n\u0131 bulabilmek i\u00e7in thread&#8217;lerin call stack&#8217;lerini query&#8217;lemektedir. Yani belirli window&#8217;larda snapshot&#8217;lar almaktad\u0131r.<\/p>\n<p>Sampling genelde long running method&#8217;larda veya performans bottleneck&#8217;lerine kar\u015f\u0131 ilk kez bir g\u00f6z at\u0131lacaksa, iyi bir se\u00e7enektir. Sampling mode&#8217;u uygulamaya herhangi bir <strong>overhead<\/strong> getirmemektedir ve\u00a0<em>CPU<\/em> time&#8217;lar\u0131n\u0131 elde edebilmek m\u00fcmk\u00fcnd\u00fcr. Sampling i\u015fleminin tek dezavantaj\u0131 ise belirli window&#8217;larda snapshot&#8217;lar ald\u0131\u011f\u0131 i\u00e7in, t\u00fcm call stack&#8217;leri capture edememektedir.<\/p>\n<h3>Tracing<\/h3>\n<p>Sampling&#8217;in aksine tracing mode&#8217;u tercih edildi\u011finde ise, profiler, profile edilen her bir method i\u00e7inde harcanan thread <em>CPU<\/em> time&#8217;\u0131n\u0131 kaydedebilmek i\u00e7in method invocation&#8217;lar\u0131n\u0131 izlemektedir (entry &amp; exit gibi).<\/p>\n<p>Tracing i\u015flemi sampling&#8217;in aksine, bize daha detayl\u0131 bilgiler sunmaktad\u0131r. Burada <em>CPU<\/em> time&#8217;lar\u0131n\u0131n yan\u0131nda, method invocation count&#8217;lar\u0131 da elde edilebilmektedir. Elbette burada bir <strong>overhead<\/strong> s\u00f6z konusudur.<\/p>\n<p>Genelde tracing i\u015flemini belirli senaryolarda veya sampling ile elde etti\u011fimiz sonu\u00e7lar yeterli gelmedi\u011fi durumlarda tercih edebiliriz.<\/p>\n<h2>1 &#8211; Perf ile <em>CPU<\/em> Activity&#8217;lerini Profile Etmek<\/h2>\n<p><em>Perf<\/em>, linux-based sistemler i\u00e7in performans ara\u015ft\u0131rmas\u0131 yapabilmemizi sa\u011flayan event-oriented bir profiling tool&#8217;udur.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2019\/01\/kernel-hardware-space.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-2529 lazyload\" data-src=\"\/wp-content\/uploads\/2019\/01\/kernel-hardware-space.png\" alt=\"\" width=\"520\" height=\"674\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/kernel-hardware-space.png 520w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/kernel-hardware-space-231x300.png 231w\" data-sizes=\"(max-width: 520px) 100vw, 520px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 520px; --smush-placeholder-aspect-ratio: 520\/674;\" \/><\/a><\/p>\n<p><em>Perf<\/em>,\u00a0<strong>kernel<\/strong> ve <strong>hardware<\/strong> event&#8217;leri ba\u015fta olmak \u00fczere, bir \u00e7ok event i\u00e7in hem tracing hem de sampling konular\u0131nda yeteneklidir. Ayr\u0131ca <em>perf<\/em>, linux kernel&#8217;\u0131n\u0131n &#8220;<em>perf_events<\/em>&#8221; interface&#8217;ini temel almaktad\u0131r ve &#8220;<em>perf_events<\/em>&#8221; e ise attach edebilece\u011fimiz bir \u00e7ok event source mevcuttur.<\/p>\n<p>\u00d6rne\u011fin:<\/p>\n<ul>\n<li>Hardware Events<\/li>\n<li>Software Events<\/li>\n<li>User Statically-Defined Tracing<\/li>\n<li>Dynamic Tracing<\/li>\n<li>etc&#8230;<\/li>\n<\/ul>\n<h3>Perf ile basit bir Profiling<\/h3>\n<p>Profiling i\u015flemine ba\u015flamadan \u00f6nce, \u00f6rnek ger\u00e7ekle\u015ftirebilmemiz i\u00e7in k\u00f6t\u00fc bir uygulamaya ihtiyac\u0131m\u0131z var. Siz dilerseniz mevcut uygulamalar\u0131n\u0131z \u00fczerinden de ilerleyebilirsiniz. Sonu\u00e7 olarak amac\u0131m\u0131z, uygulamalar\u0131m\u0131z\u0131n <em>CPU<\/em> activity&#8217;lerini g\u00f6zlemleyebilmek.<\/p>\n<p>Ben \u00f6rnek ger\u00e7ekle\u015ftirebilmek ad\u0131na,\u00a0fazlas\u0131yla <em>CPU<\/em> consuming&#8217;i yapabilecek bir console uygulamas\u0131 olu\u015fturaca\u011f\u0131m. Bu console uygulamas\u0131 kendisine verilen bir dizi say\u0131n\u0131n, ilgili index&#8217;indeki asal say\u0131y\u0131 bulan ve ard\u0131ndan karek\u00f6k&#8217;\u00fcn\u00fc hesaplayan bir uygulama olacak (Biraz abartm\u0131\u015f olabilirim, \u00f6rne\u011fe odaklanmayal\u0131m).<\/p>\n<p>Olu\u015fturmu\u015f oldu\u011fum \u00f6rnek uygulama ise a\u015fa\u011f\u0131daki gibidir.<\/p>\n<p>&#8220;<em>PrimeNumberFinderHelper.cs<\/em>&#8221; file&#8217;\u0131:<\/p>\n<pre class=\"lang:c# decode:true\">using System;\r\n\r\nnamespace PrimeNumberFinder\r\n{\r\n    public class PrimeNumberFinderHelper\r\n    {\r\n        public long FindNthPrimeNumber(int number)\r\n        {\r\n            int count = 0;\r\n            long a = 2;\r\n\r\n            while (count &lt; number)\r\n            {\r\n                long b = 2;\r\n                int prime = 1;\r\n                while (b * b &lt;= a) { if (a % b == 0) { prime = 0; break; } b++; } if (prime &gt; 0)\r\n                {\r\n                    count++;\r\n                }\r\n                a++;\r\n            }\r\n            return (--a);\r\n        }\r\n    }\r\n}<\/pre>\n<p>ve &#8220;<em>Program.cs<\/em>&#8221; file&#8217;\u0131 ise a\u015fa\u011f\u0131daki gibidir.<\/p>\n<pre class=\"lang:c# decode:true\">using System;\r\nusing System.Linq;\r\nusing System.Threading;\r\n\r\nnamespace PrimeNumberFinder\r\n{\r\n    class Program\r\n    {\r\n        static PrimeNumberFinderHelper _primeNumberFinderHelper;\r\n\r\n        static void Main(string[] args)\r\n        {\r\n            int[] numbers = GetNumbersFromArgs(args);\r\n\r\n            for (int number = 0; number &lt; numbers.Length; number++) { Console.WriteLine(\"Finding {0}nth prime number...\", numbers[number]); _primeNumberFinderHelper = new PrimeNumberFinderHelper(); long nthPrimeNumber = FindNthPrimeNumber(numbers[number]); Console.WriteLine(\"{0}nth prime number is {1}.\", numbers[number], nthPrimeNumber); double squareRootOfNthPrimeNumber = FindSquareRootOfNthPrimeNumber(nthPrimeNumber); Console.WriteLine(\"Square root of {0}nth prime number is {1}.\", numbers[number], squareRootOfNthPrimeNumber); } Console.WriteLine(\"Done!\"); } private static int[] GetNumbersFromArgs(string[] args) { return args.Select(x =&gt;\r\n            {\r\n                (bool, int) input = CheckIsItANumber(x);\r\n\r\n                if (input.Item1)\r\n                {\r\n                    return input.Item2;\r\n                }\r\n\r\n                return default(int);\r\n            }).ToArray();\r\n        }\r\n\r\n        \/\/Some child methods for profiling callchain.\r\n        static double FindSquareRootOfNthPrimeNumber(double nthPrimeNumber)\r\n        {\r\n            double squareRoot = 0;\r\n\r\n            squareRoot = Math.Sqrt(nthPrimeNumber);\r\n\r\n            Thread.Sleep(10000);\r\n\r\n            return squareRoot;\r\n        }\r\n\r\n        \/\/Some child methods for profiling callchain.\r\n        static long FindNthPrimeNumber(int number)\r\n        {\r\n            \/\/CPU intensive sample for profiling with perf on linux.\r\n            long nthPrimeNumber = _primeNumberFinderHelper.FindNthPrimeNumber(number);\r\n\r\n            return nthPrimeNumber;\r\n        }\r\n\r\n        \/\/Some child methods for profiling callchain.\r\n        static (bool, int) CheckIsItANumber(string num)\r\n        {\r\n            int? result = null;\r\n\r\n            try\r\n            {\r\n                result = int.Parse(num);\r\n            }\r\n            catch (System.Exception ex)\r\n            {\r\n                Console.WriteLine(\"Exception occured while parsing.\");\r\n            }\r\n\r\n            return (result != null, result.GetValueOrDefault()); \/\/ It can be cause wrong business logic.\r\n        }\r\n    }\r\n}<\/pre>\n<p><em>CPU<\/em> intensive \u00e7al\u0131\u015facak ve call chain&#8217;i g\u00f6rebilece\u011fimiz \u00f6rnek console uygulamam\u0131z yukar\u0131daki gibidir.<\/p>\n<p>Perf ile profiling i\u015flemine ba\u015flamadan \u00f6nce, bilmemiz gereken bir nokta var. Perf, di\u011fer debugging tool&#8217;lar\u0131nda da oldu\u011fu gibi, bizlere anlaml\u0131 bir sonu\u00e7 verebilmesi i\u00e7in &#8220;<em>symbol<\/em>&#8221; bilgilerine ihtiya\u00e7 duymaktad\u0131r. T\u0131pk\u0131 &#8220;<em>pdb<\/em>&#8221; file&#8217;lar\u0131 gibi.<\/p>\n<p>Bu sayede profile i\u015flemi sonucunda elde edece\u011fimiz bellek adresleri, bizlerin anlayabilece\u011fi bir \u015fekilde &#8220;<em>method name<\/em>&#8221; ve &#8220;<em>variable name&#8217;lere<\/em>&#8221; d\u00f6n\u00fc\u015fecektir. Aksi halde <em>C#<\/em> gibi compiled dillerde sadece hexadecimal de\u011ferleri g\u00f6r\u00fcr\u00fcz.<\/p>\n<p>Symbol bilgilerini sa\u011flayabilmek i\u00e7in enable etmemiz gereken bir <strong>environment<\/strong> de\u011feri bulunmaktad\u0131r. &#8220;<em>COMPlus_PerfMapEnabled<\/em>&#8221; de\u011ferini enable etti\u011fimizde, <em>CoreCLR<\/em>&#8216;a debug bilgilerini <em>perf&#8217;<\/em>\u00fcn kullanabilmesi i\u00e7in vermesi gerekti\u011fini s\u00f6ylemi\u015f oluyoruz.<\/p>\n<p>\u015eimdi environment de\u011ferini a\u015fa\u011f\u0131daki gibi enable edelim ve console uygulamam\u0131z\u0131 \u00e7al\u0131\u015ft\u0131ral\u0131m.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2019\/01\/perf-step-1-run.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-2478 lazyload\" data-src=\"\/wp-content\/uploads\/2019\/01\/perf-step-1-run.jpg\" alt=\"\" width=\"2360\" height=\"696\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/perf-step-1-run.jpg 2360w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/perf-step-1-run-300x88.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/perf-step-1-run-768x226.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/perf-step-1-run-1024x302.jpg 1024w\" data-sizes=\"(max-width: 2360px) 100vw, 2360px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 2360px; --smush-placeholder-aspect-ratio: 2360\/696;\" \/><\/a><\/p>\n<p>Environment de\u011ferini enable ettik ve uygulamay\u0131 bi hayli zorlayacak bir asal say\u0131y\u0131 bulmas\u0131n\u0131 s\u00f6yledik.<\/p>\n<p>Peki \u015fimdi sistem ne durumda?<\/p>\n<p>Hemen &#8220;<em>top<\/em>&#8221; command&#8217;\u0131n\u0131 yazal\u0131m ve process&#8217;lere bir bakal\u0131m.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2019\/01\/perf-step-2-activity.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-2479 lazyload\" data-src=\"\/wp-content\/uploads\/2019\/01\/perf-step-2-activity.jpg\" alt=\"\" width=\"2358\" height=\"804\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/perf-step-2-activity.jpg 2358w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/perf-step-2-activity-300x102.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/perf-step-2-activity-768x262.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/perf-step-2-activity-1024x349.jpg 1024w\" data-sizes=\"(max-width: 2358px) 100vw, 2358px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 2358px; --smush-placeholder-aspect-ratio: 2358\/804;\" \/><\/a><\/p>\n<p>G\u00f6rd\u00fcn\u00fcz m\u00fc? &#8220;<em>30989<\/em>&#8221; id&#8217;li process, <em>CPU<\/em>&#8216;nun %100 \u00fcn\u00fc kullan\u0131yor!<\/p>\n<p><a href=\"\/wp-content\/uploads\/2019\/01\/call-the-police.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-2480 lazyload\" data-src=\"\/wp-content\/uploads\/2019\/01\/call-the-police.jpg\" alt=\"\" width=\"625\" height=\"477\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/call-the-police.jpg 625w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/call-the-police-300x229.jpg 300w\" data-sizes=\"(max-width: 625px) 100vw, 625px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 625px; --smush-placeholder-aspect-ratio: 625\/477;\" \/><\/a><\/p>\n<p>Haydi bu process&#8217;i bir profile edelim. Bir bakal\u0131m uygulamam\u0131z nerede bottleneck&#8217;e d\u00fc\u015f\u00fcyor ve hangi kod path&#8217;ine odaklanmam\u0131z gerekiyor.<\/p>\n<p>En basit haliyle, &#8220;<em>30989<\/em>&#8221; id&#8217;li process i\u00e7in a\u015fa\u011f\u0131daki komut sat\u0131r\u0131 ile bir profiling i\u015flemi ba\u015flatal\u0131m.<\/p>\n<pre class=\"lang:default decode:true \">perf record -g -p 30989<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2019\/01\/perf-record.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-2482 lazyload\" data-src=\"\/wp-content\/uploads\/2019\/01\/perf-record.jpg\" alt=\"\" width=\"1700\" height=\"192\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/perf-record.jpg 1700w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/perf-record-300x34.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/perf-record-768x87.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/perf-record-1024x116.jpg 1024w\" data-sizes=\"(max-width: 1700px) 100vw, 1700px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1700px; --smush-placeholder-aspect-ratio: 1700\/192;\" \/><\/a><\/p>\n<ul>\n<li><strong>record<\/strong>: command&#8217;\u0131 ile performance counter profilini toplayaca\u011f\u0131m\u0131z\u0131 belirtiyoruz.<\/li>\n<li><strong>-g<\/strong>: parmetresi ile call graph&#8217;i almak istedi\u011fimizi belirtiyoruz. Default olarak <em>perf<\/em>, sadece time information&#8217;lar\u0131n\u0131 collect etmektedir.<\/li>\n<li><strong>-p<\/strong>: parametresi ile ise profile etmek istedi\u011fimiz process&#8217;in id&#8217;sini belirtiyoruz.<\/li>\n<\/ul>\n<blockquote><p><strong>NOT<\/strong>: Kullanabilece\u011fimiz farkl\u0131 parametreler de mevcut. \u0130lgili listeye <em><a href=\"http:\/\/man7.org\/linux\/man-pages\/man1\/perf-record.1.html\" target=\"_blank\" rel=\"noopener\">buradan<\/a><\/em> ula\u015fabilirsiniz.<\/p><\/blockquote>\n<p>Bir ka\u00e7 saniye i\u00e7erisinde ise sampling i\u015flemini durdural\u0131m. Sonucuna bakarsak, <em>perf<\/em>, bir ka\u00e7 saniye i\u00e7erisinde &#8220;<em>4.078<\/em>&#8221; MB&#8217;l\u0131k &#8220;<em>19558<\/em>&#8221; adet sample elde edebilmi\u015f. Bu elde etti\u011fi sonu\u00e7lar\u0131 ise, &#8220;<em>perf.data<\/em>&#8221; isimli bir file&#8217;a yazm\u0131\u015f.<\/p>\n<blockquote><p><strong>NOT<\/strong>: E\u011fer \u00e7ok s\u0131k \u00e7a\u011fr\u0131lan bir event dinleniyorsa, &#8220;<em>perf.data<\/em>&#8221; file&#8217;\u0131n\u0131n boyutu olduk\u00e7a b\u00fcy\u00fck olacakt\u0131r. Bunun yerine, &#8220;Memory Mapped Buffer&#8221; \u0131 kullanarak real-time olarak profiling i\u015flemini ger\u00e7ekle\u015ftirebilmek de m\u00fcmk\u00fcnd\u00fcr.<\/p><\/blockquote>\n<p>Elde etmi\u015f oldu\u011fumuz bu &#8220;<em>perf.data<\/em>&#8221; dosyas\u0131n\u0131 ister ayn\u0131 makina \u00fczerinde, isterseniz de farkl\u0131 bir makinaya ta\u015f\u0131yarak analiz etme i\u015flemini ger\u00e7ekle\u015ftirebilirsiniz.<\/p>\n<p>Peki, elde etmi\u015f oldu\u011fumuz bu profiling sonucunu nas\u0131l yorumlayabiliriz? Yine en basit haliyle, a\u015fa\u011f\u0131daki komut sat\u0131r\u0131n\u0131 \u00e7al\u0131\u015ft\u0131rarak.<\/p>\n<pre class=\"lang:default decode:true \">perf report -f<\/pre>\n<blockquote><p><strong>NOT<\/strong>: Profiling sonucunu yorumlarken herhangi bir regular user veya root user karma\u015fas\u0131 ya\u015famamak ad\u0131na, &#8220;<em>-f<\/em>&#8221; parametresi ile herhangi bir ownership do\u011frulamas\u0131n\u0131n yap\u0131lmamas\u0131n\u0131 sa\u011flayabiliriz.<\/p><\/blockquote>\n<p><a href=\"\/wp-content\/uploads\/2019\/01\/perf-report-1.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-2485 lazyload\" data-src=\"\/wp-content\/uploads\/2019\/01\/perf-report-1.png\" alt=\"\" width=\"2250\" height=\"762\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/perf-report-1.png 2250w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/perf-report-1-300x102.png 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/perf-report-1-768x260.png 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/perf-report-1-1024x347.png 1024w\" data-sizes=\"(max-width: 2250px) 100vw, 2250px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 2250px; --smush-placeholder-aspect-ratio: 2250\/762;\" \/><\/a><\/p>\n<p>Evet, &#8220;<em>30989&#8243; <\/em>id&#8217;li process&#8217;in\u00a0profiling sonucu art\u0131k kar\u015f\u0131m\u0131zda. Yukar\u0131daki sonu\u00e7 \u00fczerinden, process&#8217;in call stack&#8217;leri \u00fczerindeki <em>CPU<\/em> activity&#8217;lerini g\u00f6rebilmek m\u00fcmk\u00fcnd\u00fcr. &#8220;<em>Symbol<\/em>&#8221; k\u0131s\u0131mlar\u0131na dikkat edersek, bizi ilgilendiren noktalar\u0131n method name ve variable name&#8217;lere d\u00f6n\u00fc\u015ft\u00fc\u011f\u00fcn\u00fc g\u00f6rebiliriz.<\/p>\n<p>&#8220;<em>Children<\/em>&#8221; k\u0131sm\u0131 subsequent call&#8217;lar\u0131n overhead&#8217;lerini g\u00f6stermektedir. \u0130lk sat\u0131ra bakarsak, &#8220;<em>Children<\/em>&#8221; k\u0131sm\u0131n\u0131n <strong>%100<\/strong> oldu\u011funu, fakat &#8220;<em>Self<\/em>&#8221; k\u0131sm\u0131n\u0131n <strong>%0<\/strong> oldu\u011funu g\u00f6rebiliriz. Yani &#8220;<em>Children<\/em>&#8221; k\u0131sm\u0131 bize diyor ki, &#8220;ben maliyetli bir yolda ilerliyorum, fakat o maliyetli yol \u015fu an buras\u0131 de\u011fil&#8221;. &#8220;<em>Self<\/em>&#8221; k\u0131sm\u0131 ise, o maliyetli k\u0131sm\u0131n oldu\u011fu yer.<\/p>\n<p>Highlight yapt\u0131\u011f\u0131m sat\u0131ra bakarsak, &#8220;<em>Self<\/em>&#8221; de\u011ferinin <strong>%99.93<\/strong> oldu\u011funu g\u00f6rebiliriz. Bu process i\u00e7in <em>CPU<\/em> consuming&#8217;inin ger\u00e7ekle\u015fti\u011fi noktan\u0131n, &#8220;<em>PrimeNumberFinderHelper<\/em>&#8221; class&#8217;\u0131 i\u00e7erisindeki &#8220;<em>FindNthPrimeNumber<\/em>&#8221; method&#8217;unda ger\u00e7ekle\u015fti\u011fini s\u00f6yleyebiliriz. Bizim bir developer olarak odaklanmam\u0131z gereken nokta!<\/p>\n<p>Peki, bu &#8220;<em>PrimeNumberFinderHelper<\/em>&#8221; instance&#8217;\u0131 nerede kullan\u0131l\u0131yor? Haydi biraz daha kaz\u0131yal\u0131m, call&#8217;lara bakal\u0131m! Bunun i\u00e7in highlight edilmi\u015f sat\u0131r\u0131n \u00fczerinde, &#8220;<em>enter<\/em>&#8221; tu\u015funa basmam\u0131z yeterli olacakt\u0131r.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2019\/01\/perf-report-2.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-2486 lazyload\" data-src=\"\/wp-content\/uploads\/2019\/01\/perf-report-2.png\" alt=\"\" width=\"2252\" height=\"764\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/perf-report-2.png 2252w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/perf-report-2-300x102.png 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/perf-report-2-768x261.png 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/perf-report-2-1024x347.png 1024w\" data-sizes=\"(max-width: 2252px) 100vw, 2252px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 2252px; --smush-placeholder-aspect-ratio: 2252\/764;\" \/><\/a><\/p>\n<p>Bottleneck&#8217;in oldu\u011fu tree&#8217;nin en alt k\u0131sm\u0131na bakarsak, kod ak\u0131\u015f\u0131n\u0131n &#8220;<em>PrimeNumberFinder.Program::Main<\/em>&#8221; method&#8217;undan ge\u00e7tikten sonra, &#8220;<em>PrimeNumberFinderHelper<\/em>&#8221; class&#8217;\u0131n\u0131n instance&#8217;\u0131 \u00fczerinden &#8220;<em>FindNthPrimeNumber<\/em>&#8221; method&#8217;unu call etti\u011fini g\u00f6rebiliriz.<\/p>\n<blockquote><p><strong>NOT<\/strong>: <em>Perf<\/em>&#8216;\u00fcn &#8220;<em>report<\/em>&#8221; command&#8217;\u0131nda da kullan\u0131labilecek bir \u00e7ok farkl\u0131 parametreler mevcuttur. \u00d6rne\u011fin verbose seviyesini artt\u0131rabilirsiniz, symbol bilgileri resolve edilmeyenleri gizleyebilirsiniz veya call graph&#8217;i farkl\u0131 parametrelere g\u00f6re g\u00f6r\u00fcnt\u00fcleyebilirsiniz. Detayl\u0131 listeye <em><a href=\"http:\/\/man7.org\/linux\/man-pages\/man1\/perf-report.1.html\">buradan<\/a><\/em> eri\u015febilirsiniz.<\/p><\/blockquote>\n<p>En basit haliyle, process \u00fczerinde bir sampling i\u015flemi ger\u00e7ekle\u015ftirerek problemli noktam\u0131z\u0131 belirlemi\u015f olduk. Art\u0131k bir developer olarak odaklanmam\u0131z gereken noktay\u0131 biliyoruz.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2019\/01\/happy-nerd.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-2538 lazyload\" data-src=\"\/wp-content\/uploads\/2019\/01\/happy-nerd.jpg\" alt=\"\" width=\"564\" height=\"604\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/happy-nerd.jpg 928w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/happy-nerd-280x300.jpg 280w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/happy-nerd-768x823.jpg 768w\" data-sizes=\"(max-width: 564px) 100vw, 564px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 564px; --smush-placeholder-aspect-ratio: 564\/604;\" \/><\/a><\/p>\n<h2>2 &#8211; LTTng ile Runtime Event&#8217;lerini Trace Etmek<\/h2>\n<p><a href=\"\/wp-content\/uploads\/2019\/01\/lttng-logo.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-2513 lazyload\" data-src=\"\/wp-content\/uploads\/2019\/01\/lttng-logo.png\" alt=\"\" width=\"1600\" height=\"900\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/lttng-logo.png 1600w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/lttng-logo-300x169.png 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/lttng-logo-768x432.png 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/lttng-logo-1024x576.png 1024w\" data-sizes=\"(max-width: 1600px) 100vw, 1600px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1600px; --smush-placeholder-aspect-ratio: 1600\/900;\" \/><\/a><\/p>\n<p>Runtime event&#8217;lerinin tracing konusunda ise <em>lttng<\/em> tool&#8217;undan yararlanaca\u011f\u0131z.\u00a0<em>LTTng<\/em>, <em>CoreCLR<\/em>&#8216;\u0131n build-time&#8217;da generate etti\u011fi tracepoint&#8217;leri kullanarak, <strong>user-space<\/strong> event&#8217;lerini handle etmektedir (yani runtime service&#8217;leri ve application-level event&#8217;ler gibi).<a href=\"\/wp-content\/uploads\/2019\/01\/user-space-2.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-2530 lazyload\" data-src=\"\/wp-content\/uploads\/2019\/01\/user-space-2.png\" alt=\"\" width=\"520\" height=\"674\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/user-space-2.png 520w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/user-space-2-231x300.png 231w\" data-sizes=\"(max-width: 520px) 100vw, 520px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 520px; --smush-placeholder-aspect-ratio: 520\/674;\" \/><\/a><\/p>\n<p><em>LTTng<\/em>, windows taraf\u0131ndaki <em>ETW<\/em> (Event Tracing for Windows) event&#8217;lere benzer bir \u015fekilde, daha zor yani daha derinlemesine problemleri ele alabilmemize olanak sa\u011flayan lightweight bir tracing framework&#8217;\u00fcd\u00fcr.<\/p>\n<p>Ne yaz\u0131kki <em>ETW<\/em> events, linux ortam\u0131nda bulunmamaktad\u0131r.\u00a0<em>ETW<\/em> event&#8217;lere benzer bir \u015fekilde tracing i\u015flemlerini linux ortam\u0131nda ise <em>lttng<\/em> framework&#8217;\u00fc ile ger\u00e7ekle\u015ftirebilmekteyiz.<\/p>\n<p><em>LTTng<\/em> ile trace edebilece\u011fimiz baz\u0131 event&#8217;lere bakarsak:<\/p>\n<ul>\n<li>Garbage collections<\/li>\n<li>Assembly load\/unload<\/li>\n<li>Thread start\/stop<\/li>\n<li>Object allocations<\/li>\n<li>Exception thrown<\/li>\n<\/ul>\n<p>gibi event&#8217;leri trace edebilmek m\u00fcmk\u00fcnd\u00fcr. <em>Perf<\/em>&#8216;de oldu\u011fu gibi trace file&#8217;\u0131 ister ayn\u0131 makina \u00fczerinde istersek de ba\u015fka bir makina \u00fczerinde analyze edebilmek m\u00fcmk\u00fcnd\u00fcr.<\/p>\n<p>Peki, az laf \u00e7ok i\u015f diyelim ve uygulamaya ge\u00e7elim.<\/p>\n<p><em>LTTng<\/em> ile ger\u00e7ekle\u015ftirece\u011fimiz \u00f6rnek senaryoda ise bir <em>API<\/em>&#8216;\u0131m\u0131z oldu\u011funu ve bu <em>API<\/em>&#8216;\u0131n, memory&#8217;sini efficient bir \u015fekilde kullanmas\u0131 gerekti\u011fini d\u00fc\u015f\u00fcnelim.<\/p>\n<p><em>LTTng<\/em> ile tracing i\u015flemine ba\u015flamadan \u00f6nce enable etmemiz gereken bir <strong>environment<\/strong> de\u011feri bulunmaktad\u0131r. &#8220;<em>COMPlus_EnableEventLog<\/em>&#8221; de\u011ferini enable etti\u011fimizde, <em>CoreCLR<\/em>&#8216;a event log&#8217;lar\u0131 kullanabilmemiz i\u00e7in generate etmesini s\u00f6ylemi\u015f oluyoruz.<\/p>\n<p>\u00d6rnek <em>API<\/em>&#8216;\u0131n kaynak kodlar\u0131na ise <em><a href=\"https:\/\/github.com\/GokGokalp\/dotnetKonf-03-11-18-conference\">buradan<\/a><\/em> ula\u015fabilirsiniz. <em>Perf<\/em> ile ger\u00e7ekle\u015ftirmi\u015f oldu\u011fumuz \u00f6rne\u011fe benzemektedir. Bu <em>API<\/em> i\u00e7erisindeki &#8220;<em>api\/calculate<\/em>&#8221; endpoint&#8217;ine bir dizi say\u0131lar g\u00f6nderece\u011fiz ve ard\u0131ndan <em>API<\/em> i\u00e7erisinde olu\u015fan <strong>object allocation<\/strong>&#8216;lara bir bakaca\u011f\u0131z.<\/p>\n<p>Kullanaca\u011f\u0131m\u0131z komut sat\u0131rlar\u0131 ise a\u015fa\u011f\u0131daki gibidir.<\/p>\n<pre class=\"lang:default decode:true\">sudo lttng create gc-trace -o .\/dotnetkonf-trace\r\nsudo lttng add-context --userspace --type vpid\r\nsudo lttng add-context --userspace --type vtid\r\nsudo lttng add-context --userspace --type procname\r\nsudo lttng enable-event --userspace --tracepoint DotNETRuntime:GCStart*\r\nsudo lttng enable-event --userspace --tracepoint DotNETRuntime:GCEnd*\r\nsudo lttng enable-event --userspace --tracepoint DotNETRuntime:GCHeapStats*\r\nsudo lttng enable-event --userspace --tracepoint DotNETRuntime:GCAllocationTick*\r\nsudo lttng enable-event --userspace --tracepoint DotNETRuntime:GCTriggered\r\nsudo lttng start\r\nsleep 20\r\nsudo lttng stop\r\nsudo lttng destroy<\/pre>\n<p>\u0130lk komut sat\u0131r\u0131nda &#8220;<em>gc-trace<\/em>&#8221; ad\u0131nda bir session olu\u015fturmas\u0131n\u0131 ve ilgili tracing \u00e7\u0131kt\u0131lar\u0131n\u0131 &#8220;<em>dotnetkonf-trace<\/em>&#8221; path&#8217;i alt\u0131nda toplamas\u0131 gerekti\u011fini s\u00f6yedik. Sonraki sat\u0131rlarda ise &#8220;<em>lttng add-context<\/em>&#8221; parametresi ile, her bir event&#8217;in &#8220;<em>process id<\/em>&#8220;, &#8220;<em>thread id<\/em>&#8221; ve &#8220;<em>process name<\/em>&#8221; gibi bilgilere sahip olmas\u0131n\u0131 istedi\u011fimizi belirttik.<\/p>\n<p>En \u00f6nemlisi ise &#8220;<em>lttng enable-event<\/em>&#8221; parametresi ile, trace etmek istedi\u011fimiz <strong>tracepoint&#8217;<\/strong>leri tan\u0131mlad\u0131k. Bu sayede <em>CoreCLR<\/em> taraf\u0131ndan generate edilecek olan &#8220;<em>DotNETRuntime:GCStart*&#8221;<\/em>\u00a0ve &#8220;<em>GCAllocationTick*&#8221;\u00a0<\/em>gibi \u00f6nemli event&#8217;leri trace edebilece\u011fiz. T\u00fcm bunlar\u0131n ard\u0131ndan tracing i\u015flemini ba\u015flat\u0131yoruz ve &#8220;<em>20<\/em>&#8221; saniye gibi bir s\u00fcre beklettikten sonra (tracing i\u015flemi, sampling i\u015fleminin aksine biraz zaman gerektiren bir i\u015flemdir) i\u015flemi durdurup, session&#8217;\u0131 destroy ediyoruz.<\/p>\n<blockquote><p><strong>NOT<\/strong>: Bu komutlar\u0131n hepsini tek tek yazmak elbette zor olacakt\u0131r. Bu sebeple dilerseniz sizde benim yararland\u0131\u011f\u0131m makefile&#8217;a <em><a href=\"https:\/\/github.com\/GokGokalp\/dotnetKonf-03-11-18-conference\/blob\/master\/Makefile\" target=\"_blank\" rel=\"noopener\">buradan<\/a><\/em> eri\u015febilir ve kullanabilirsiniz.<\/p><\/blockquote>\n<p>Tracing i\u015flemini ba\u015flatmadan \u00f6nce a\u015fa\u011f\u0131daki gibi \u00f6rnek <em>API<\/em>&#8216;\u0131 \u00e7al\u0131\u015ft\u0131ral\u0131m ve &#8220;<em>api\/calculate<span class=\"pl-k\">?<\/span>nums=100,200,300,400,500<\/em>&#8221; <em>URL<\/em>&#8216;ine biraz istek g\u00f6nderelim. Ben istek g\u00f6nderme i\u015flemini\u00a0<em>Apache Bench <\/em>vas\u0131tas\u0131yla\u00a0ger\u00e7ekle\u015ftirece\u011fim.<\/p>\n<pre class=\"lang:default decode:true\">ab -n 10000 localhost:5000\/api\/calculate?nums=100,200,300,400,500<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2019\/01\/lttng-part-1.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-2522 lazyload\" data-src=\"\/wp-content\/uploads\/2019\/01\/lttng-part-1.jpg\" alt=\"\" width=\"3006\" height=\"488\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/lttng-part-1.jpg 3006w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/lttng-part-1-300x49.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/lttng-part-1-768x125.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/lttng-part-1-1024x166.jpg 1024w\" data-sizes=\"(max-width: 3006px) 100vw, 3006px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 3006px; --smush-placeholder-aspect-ratio: 3006\/488;\" \/><\/a><\/p>\n<p>\u0130stek g\u00f6nderme i\u015flemi devam ederken yani uygulamam\u0131z aktif olarak \u00e7al\u0131\u015f\u0131rken, tracing i\u015flemini a\u015fa\u011f\u0131daki gibi ba\u015flatal\u0131m.<a href=\"\/wp-content\/uploads\/2019\/01\/lttng-create.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-2524 lazyload\" data-src=\"\/wp-content\/uploads\/2019\/01\/lttng-create.jpg\" alt=\"\" width=\"1702\" height=\"884\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/lttng-create.jpg 1702w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/lttng-create-300x156.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/lttng-create-768x399.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/lttng-create-1024x532.jpg 1024w\" data-sizes=\"(max-width: 1702px) 100vw, 1702px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1702px; --smush-placeholder-aspect-ratio: 1702\/884;\" \/><\/a><\/p>\n<p>Tracing i\u015flemi <em>20<\/em> saniye bekledikten sonra duracakt\u0131r.<\/p>\n<p>Peki &#8220;<em>dotnetkonf-trace<\/em>&#8221; path&#8217;i alt\u0131nda toplanan tracing sonu\u00e7lar\u0131n\u0131 nas\u0131l yorumlayabiliriz? \u0130lk se\u00e7enek olarak, default gelen simple bir viewer olan <em>babeltrace<\/em>&#8216;i kullanabiliriz.<\/p>\n<p>Dilerseniz daha user-friendly olan,\u00a0<em>Eclipse Trace Compass<\/em> \u00fcr\u00fcn\u00fcn\u00fc de kullanabilirsiniz. Tracing sonu\u00e7lar\u0131 <em>CTF<\/em>(Common Trace Format) format\u0131nda \u00e7\u0131kt\u0131\u011f\u0131 i\u00e7in, <em>Trace Compas<\/em>s ile g\u00f6rsel olarak da g\u00f6r\u00fcnt\u00fcleyebilmek m\u00fcmk\u00fcnd\u00fcr.<\/p>\n<p>Her neyse, a\u015fa\u011f\u0131daki komut sat\u0131r\u0131 ile tracing sonucuna bakmaya ba\u015flayal\u0131m.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2019\/01\/collect-all.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-2536 lazyload\" data-src=\"\/wp-content\/uploads\/2019\/01\/collect-all.png\" alt=\"\" width=\"510\" height=\"383\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/collect-all.png 510w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/collect-all-300x225.png 300w\" data-sizes=\"(max-width: 510px) 100vw, 510px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 510px; --smush-placeholder-aspect-ratio: 510\/383;\" \/><\/a><\/p>\n<pre class=\"lang:default decode:true\">sudo babeltrace .\/dotnetkonf-trace | grep GCAllocationTick* | grep 'TypeName = \"[^\"]*\"' -o | sort | uniq -c | sort -n<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2019\/01\/lttng-report.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-2525 lazyload\" data-src=\"\/wp-content\/uploads\/2019\/01\/lttng-report.jpg\" alt=\"\" width=\"2170\" height=\"880\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/lttng-report.jpg 2170w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/lttng-report-300x122.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/lttng-report-768x311.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/lttng-report-1024x415.jpg 1024w\" data-sizes=\"(max-width: 2170px) 100vw, 2170px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 2170px; --smush-placeholder-aspect-ratio: 2170\/880;\" \/><\/a><\/p>\n<p>ve sonu\u00e7 kar\u015f\u0131m\u0131zda.<\/p>\n<p>Sizlerinde g\u00f6rd\u00fc\u011f\u00fc gibi <em>20<\/em> saniye gibi bir s\u00fcre i\u00e7erisinde,\u00a0<em>957<\/em> adet &#8220;<em>System.String<\/em>&#8221; ve <em>244<\/em> adet &#8220;<em>System.Object[]<\/em>&#8221; gibi object&#8217;ler <em>API<\/em> i\u00e7erisinde allocate edildi. Bu arada, buradaki bilmemiz gereken nokta ise, bu sonu\u00e7lar her bir allocation&#8217;\u0131n sonucu de\u011fildir. Yakla\u015f\u0131k <strong>100KB<\/strong>&#8216;a ula\u015fan allocation&#8217;lar\u0131n sonucudur.<\/p>\n<p>Peki, bu object allocation&#8217;lar nereden geliyor? Bunlar\u0131n bir call stack bilgileri yok mu diye d\u00fc\u015f\u00fcn\u00fcyorsan\u0131z, do\u011fru yoldas\u0131n\u0131z. Maalesef <strong>user-space<\/strong> i\u00e7in <em>lttng<\/em>&#8216;nin\u00a0stack trace supportu hen\u00fcz bulunmamaktad\u0131r. (San\u0131r\u0131m <em>2.11<\/em> release i\u00e7erisinde planl\u0131yorlar:\u00a0<em>LTTng<\/em> <strong><a href=\"https:\/\/github.com\/lttng\/lttng-tools\/milestone\/5?closed=1\" target=\"_blank\" rel=\"noopener\">milestone<\/a><\/strong>)<\/p>\n<p>Stack trace bilgilerine eri\u015febilmenin ise bir ka\u00e7 farkl\u0131 y\u00f6ntemi vard\u0131r. <em>Sasha Goldshtein<\/em>&#8216;in g\u00fczel bir <em><a href=\"https:\/\/blogs.microsoft.co.il\/sasha\/2018\/02\/06\/getting-stacks-for-lttng-events-with-net-core-on-linux\/\" target=\"_blank\" rel=\"noopener\">makalesi<\/a><\/em> var bu konuda. Bu y\u00f6ntemler ile birlikte <strong>core dump<\/strong> analiz i\u015flemlerini de bir sonraki makalemde bende de\u011finiyor olaca\u011f\u0131m.<\/p>\n<p>Takipte kal\u0131n.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2019\/01\/to-be-co.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-2526 lazyload\" data-src=\"\/wp-content\/uploads\/2019\/01\/to-be-co.png\" alt=\"\" width=\"1024\" height=\"583\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/to-be-co.png 1024w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/to-be-co-300x171.png 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/to-be-co-768x437.png 768w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/583;\" \/><\/a><\/p>\n<h4>Baz\u0131 Referanslar<\/h4>\n<blockquote><p><em>https:\/\/www.embedded.com\/design\/operating-systems\/4401769\/Device-drivers-in-user-space<\/em><br \/>\n<em>http:\/\/www.brendangregg.com\/perf.html<\/em><br \/>\n<em>https:\/\/lttng.org\/docs\/v2.10\/<\/em><br \/>\n<em>http:\/\/blogs.microsoft.co.il\/sasha\/2017\/03\/30\/tracing-runtime-events-in-net-core-on-linux\/<\/em><br \/>\n<em>https:\/\/lttng.org\/blog\/2018\/08\/28\/bringing-dotnet-perf-analysis-to-linux\/<\/em><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Genelde hayat\u0131m\u0131zdaki b\u00fct\u00fcn i\u015flerin, her zaman iyi bir \u015fekilde yolunda gitmesini bekleriz\/isteriz. (Asl\u0131nda kim beklemez ki?) Maalesef bir \u00e7ok zaman ise, i\u015fler bekledi\u011fimiz, planlad\u0131\u011f\u0131m\u0131z veya umdu\u011fumuz gibi olmuyor, iyi bir \u015fekilde yolunda gitmiyor. Bir developer olarak beklentilerimiz, hayat\u0131m\u0131zda oldu\u011fu gibi, geli\u015ftirdi\u011fimiz uygulamalarda da asl\u0131nda her&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/gokhan-gokalp.com\/tr\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\/\">Devam\u0131n\u0131 okuyun<span class=\"screen-reader-text\">.NET Core Uygulamalar\u0131n\u0131n Linux \u00dczerinde Debugging &#038; Profiling \u0130\u015flemlerine Genel Bak\u0131\u015f &#8211; 1 (Perf, LTTNg)<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":2463,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[505,417,175,231],"tags":[508,513,514,512,510,509,511,506,507],"class_list":["post-2448","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-net-core","category-asp-net-core","category-performans-profiling","category-refactoring","tag-asp-net-core-performance","tag-asp-net-core-performance-analysis","tag-asp-net-core-performans-analizi","tag-asp-net-core-profiling","tag-asp-net-core-tracing","tag-dump-analysis","tag-linux-core-dump","tag-lttng","tag-perf","entry"],"translation":{"provider":"WPGlobus","version":"3.0.2","language":"tr","enabled_languages":["en","tr"],"languages":{"en":{"title":true,"content":true,"excerpt":false},"tr":{"title":true,"content":true,"excerpt":false}}},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>.NET Core Uygulamalar\u0131n\u0131n Linux \u00dczerinde Debugging &amp; Profiling \u0130\u015flemlerine Genel Bak\u0131\u015f - 1 (Perf, LTTNg) - G\u00f6khan G\u00f6kalp<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gokhan-gokalp.com\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\".NET Core Uygulamalar\u0131n\u0131n Linux \u00dczerinde Debugging &amp; Profiling \u0130\u015flemlerine Genel Bak\u0131\u015f - 1 (Perf, LTTNg) - G\u00f6khan G\u00f6kalp\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gokhan-gokalp.com\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\/\" \/>\n<meta property=\"og:site_name\" content=\"G\u00f6khan G\u00f6kalp\" \/>\n<meta property=\"article:published_time\" content=\"2019-01-26T21:26:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-02-18T08:39:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/loading-response.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1594\" \/>\n\t<meta property=\"og:image:height\" content=\"766\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"G\u00f6khan G\u00f6kalp\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Yazan:\" \/>\n\t<meta name=\"twitter:data1\" content=\"G\u00f6khan G\u00f6kalp\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data2\" content=\"27 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\\\/\"},\"author\":{\"name\":\"G\u00f6khan G\u00f6kalp\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\"},\"headline\":\".NET Core Uygulamalar\u0131n\u0131n Linux \u00dczerinde Debugging &#038; Profiling \u0130\u015flemlerine Genel Bak\u0131\u015f &#8211; 1 (Perf, LTTNg)\",\"datePublished\":\"2019-01-26T21:26:11+00:00\",\"dateModified\":\"2019-02-18T08:39:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\\\/\"},\"wordCount\":4828,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\"},\"image\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/loading-response.png\",\"keywords\":[\"asp.net core performance\",\"asp.net core performance analysis\",\"asp.net core performans analizi\",\"asp.net core profiling\",\"asp.net core tracing\",\"dump analysis\",\"linux core dump\",\"lttng\",\"perf\"],\"articleSection\":[\".NET Core\",\"ASP.NET Core\",\"Performans (Profiling)\",\"Refactoring\"],\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/gokhan-gokalp.com\\\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\\\/\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\\\/\",\"name\":\".NET Core Uygulamalar\u0131n\u0131n Linux \u00dczerinde Debugging & Profiling \u0130\u015flemlerine Genel Bak\u0131\u015f - 1 (Perf, LTTNg) - G\u00f6khan G\u00f6kalp\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/loading-response.png\",\"datePublished\":\"2019-01-26T21:26:11+00:00\",\"dateModified\":\"2019-02-18T08:39:53+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\\\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gokhan-gokalp.com\\\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\\\/#primaryimage\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/loading-response.png\",\"contentUrl\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/loading-response.png\",\"width\":1594,\"height\":766},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gokhan-gokalp.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Overview of Debugging &#038; Profiling .NET Core Applications on Linux &#8211; 1 (Perf, LTTNg)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#website\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/\",\"name\":\"G\u00f6khan G\u00f6kalp\",\"description\":\"C# &amp; Python lover\",\"publisher\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gokhan-gokalp.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"tr\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\",\"name\":\"G\u00f6khan G\u00f6kalp\",\"pronouns\":\"he\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/litespeed\\\/avatar\\\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/litespeed\\\/avatar\\\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659\",\"contentUrl\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/litespeed\\\/avatar\\\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659\",\"caption\":\"G\u00f6khan G\u00f6kalp\"},\"logo\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/litespeed\\\/avatar\\\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659\"},\"sameAs\":[\"https:\\\/\\\/gokhan-gokalp.com\"],\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/tr\\\/author\\\/gok-gokalp\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":".NET Core Uygulamalar\u0131n\u0131n Linux \u00dczerinde Debugging & Profiling \u0130\u015flemlerine Genel Bak\u0131\u015f - 1 (Perf, LTTNg) - G\u00f6khan G\u00f6kalp","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/gokhan-gokalp.com\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\/","og_locale":"tr_TR","og_type":"article","og_title":".NET Core Uygulamalar\u0131n\u0131n Linux \u00dczerinde Debugging & Profiling \u0130\u015flemlerine Genel Bak\u0131\u015f - 1 (Perf, LTTNg) - G\u00f6khan G\u00f6kalp","og_url":"https:\/\/gokhan-gokalp.com\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\/","og_site_name":"G\u00f6khan G\u00f6kalp","article_published_time":"2019-01-26T21:26:11+00:00","article_modified_time":"2019-02-18T08:39:53+00:00","og_image":[{"width":1594,"height":766,"url":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/loading-response.png","type":"image\/png"}],"author":"G\u00f6khan G\u00f6kalp","twitter_card":"summary_large_image","twitter_misc":{"Yazan:":"G\u00f6khan G\u00f6kalp","Tahmini okuma s\u00fcresi":"27 dakika"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/gokhan-gokalp.com\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\/#article","isPartOf":{"@id":"https:\/\/gokhan-gokalp.com\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\/"},"author":{"name":"G\u00f6khan G\u00f6kalp","@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe"},"headline":".NET Core Uygulamalar\u0131n\u0131n Linux \u00dczerinde Debugging &#038; Profiling \u0130\u015flemlerine Genel Bak\u0131\u015f &#8211; 1 (Perf, LTTNg)","datePublished":"2019-01-26T21:26:11+00:00","dateModified":"2019-02-18T08:39:53+00:00","mainEntityOfPage":{"@id":"https:\/\/gokhan-gokalp.com\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\/"},"wordCount":4828,"commentCount":0,"publisher":{"@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe"},"image":{"@id":"https:\/\/gokhan-gokalp.com\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\/#primaryimage"},"thumbnailUrl":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/loading-response.png","keywords":["asp.net core performance","asp.net core performance analysis","asp.net core performans analizi","asp.net core profiling","asp.net core tracing","dump analysis","linux core dump","lttng","perf"],"articleSection":[".NET Core","ASP.NET Core","Performans (Profiling)","Refactoring"],"inLanguage":"tr","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/gokhan-gokalp.com\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/gokhan-gokalp.com\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\/","url":"https:\/\/gokhan-gokalp.com\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\/","name":".NET Core Uygulamalar\u0131n\u0131n Linux \u00dczerinde Debugging & Profiling \u0130\u015flemlerine Genel Bak\u0131\u015f - 1 (Perf, LTTNg) - G\u00f6khan G\u00f6kalp","isPartOf":{"@id":"https:\/\/gokhan-gokalp.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/gokhan-gokalp.com\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\/#primaryimage"},"image":{"@id":"https:\/\/gokhan-gokalp.com\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\/#primaryimage"},"thumbnailUrl":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/loading-response.png","datePublished":"2019-01-26T21:26:11+00:00","dateModified":"2019-02-18T08:39:53+00:00","breadcrumb":{"@id":"https:\/\/gokhan-gokalp.com\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gokhan-gokalp.com\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\/"]}]},{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/gokhan-gokalp.com\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\/#primaryimage","url":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/loading-response.png","contentUrl":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2019\/01\/loading-response.png","width":1594,"height":766},{"@type":"BreadcrumbList","@id":"https:\/\/gokhan-gokalp.com\/overview-of-debugging-and-profiling-net-core-applications-on-linux-1-perf-lttng\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gokhan-gokalp.com\/"},{"@type":"ListItem","position":2,"name":"Overview of Debugging &#038; Profiling .NET Core Applications on Linux &#8211; 1 (Perf, LTTNg)"}]},{"@type":"WebSite","@id":"https:\/\/gokhan-gokalp.com\/#website","url":"https:\/\/gokhan-gokalp.com\/","name":"G\u00f6khan G\u00f6kalp","description":"C# &amp; Python lover","publisher":{"@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gokhan-gokalp.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"tr"},{"@type":["Person","Organization"],"@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe","name":"G\u00f6khan G\u00f6kalp","pronouns":"he","image":{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/gokhan-gokalp.com\/wp-content\/litespeed\/avatar\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659","url":"https:\/\/gokhan-gokalp.com\/wp-content\/litespeed\/avatar\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659","contentUrl":"https:\/\/gokhan-gokalp.com\/wp-content\/litespeed\/avatar\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659","caption":"G\u00f6khan G\u00f6kalp"},"logo":{"@id":"https:\/\/gokhan-gokalp.com\/wp-content\/litespeed\/avatar\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659"},"sameAs":["https:\/\/gokhan-gokalp.com"],"url":"https:\/\/gokhan-gokalp.com\/tr\/author\/gok-gokalp\/"}]}},"_links":{"self":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts\/2448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/comments?post=2448"}],"version-history":[{"count":60,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts\/2448\/revisions"}],"predecessor-version":[{"id":2542,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts\/2448\/revisions\/2542"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/media\/2463"}],"wp:attachment":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/media?parent=2448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/categories?post=2448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/tags?post=2448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}