Good morning everybody. I have to say you're missing five other excellent talks, so thanks for coming for my talk This is a very heavily battled slot at the moment Hi, so I'm Christian Hymas. I'm going to talk to you about profiling and tracing with different tooling and One reason why I started to look into the topic was an issue I faced a couple of years ago that well Their systems were like every five minutes Like a blocking it the whole system didn't respond for a couple of seconds And we couldn't figure that out for a long time and both were kind of like yeah angry because we lost a bit of money That's really annoying and with the two thing I will show you you can actually figure that out in a similar talk we had yesterday Which I missed while I was giving another talk with Steve Dower What by Christoph here who looked into why is? So a problem with the gill or problem with me because the system is not responding and One of the final Motivations for this talk is something when I part of this talk for originally talk at a general web developer conference with Exams in Python and PHP to pure Python using requests Figured out there's a big block like almost 40% wasting on something very very interesting And so this is a flame graph of requests call At the end we'll see what that thing actually is this blog and why you should use requests dot session if you do lot of requests in a loop an alternative title for this talk is also Actually two and a half use cases for tracing tools because you can only you can use the tracing tools on only for Debugging and profiling there's also something very cool for any body working in quality engineering or a test Which I will show later on I learned that just half a year ago at another conference. So who am I? Hi I'm from Hamburg a Python called over you think Python for 18 years almost now working mostly in security in Python and I'm making money by working for Red Hat on security engineering software stack called free IPA So a gender and gold for the stock is to explain what this picture is all about so this is a Not all a big fraction of different profiling and tracing and performance investigation tools for Linux for different kinds of the stack down from what the CPU is doing on a very very low level to very very high level with the application is doing After a short introduction I will introduce you to user space tracing tools based on the P traces call and The second half will be about kernel tracing and hardware tracing tool that can go down to the very very low level Summary and I may have I don't think maybe five minutes of question and answers some special thanks, so a lot of these demos are going to show Based on tooling and blog posts by Brandon Greg So if you're interested in profiling and tracing go to Brandon Greg's website, he's fantastic Victor's dinner also has been investing lots of time to optimize Python and has some very helpful Explanations how to do proper benchmarking because benchmarking is super hard and super hard to get correct Dimitri 11. I'm at him the maintainer of S trace at a conference a while ago Along some of the cool new tricks and another engineer redhead to show me another couple of tricks for tracing for system engineers So this is a combination of some talks that saw before some tooling. I've been using for a while and yeah introduction So some technology most people think of debugging as like identifying like removing bugs Which is usually if you do debugging as an engineer It's very costly because you have to invest a bit time You can't do that easily on a production system because you slow down production system a lot So you need to both your like your additional fake production system or your staging system at data and you can't actually Do much of the same things because you don't see kind of traffic patterns So there's a better thing. It's tracing which I will show he is more like observing monitoring We do it the right way. That's why there's small star on your fast It's doesn't slow down your production system much It's still a small impact, but it's mostly okay and better than having big performance issue in production And once you do tracing and get data as a by a product You can also do some kind of profiling and data analysis and visually visualization of what's going wrong A mythology so that different kinds of tracing The simplest part you may know is like application level tracing you will debug build you have some kind of tooling that rise lock files somewhere like My sequel slow query a python at a high level so set trace call you can add a call back that gets called when something is going on Etc. Etc. There are also more User space tracing that go a bit deeper like on the sea level You can load something into your process space while the preloads you can use use p tracing Even deeper is colonel Space tracing which uses the colonel to investigate what the operating system doing a lower level or how user space Communicates with colonel space and hardware and finally there's actually hardware tracing So any modern CPUs had special capabilities to do hardware performance counting Power management unit controls you can see what different health cache levels and just things in your computer actually do To do tracing you often have to do some special steps You have to install some tooling often you need special permission so you can't do some of the tracing as a user and Sometimes not even as an admin so you have to disable some protections like you have to disable secure boot To inject colonel models because low-level tracing often like life patching your colonel which is a bit scary But also very cool Just write stuff that runs in the colonel unlimited accessing all hardware. Yeah, but Did you tracing profiling understand what's going on a big issue is? Statistics are very hard. So you should at least know a bit of statistics and You may know the first phrase the second one is German for who measures measures fertilizer, so just to Or manure. Yeah So don't understand statistics just some things if you're interested in that you should learn about as different kinds Or what's different than average mean and for profiling often very useful to you get the person tall so How good are 95% of all requests are 99% because you don't often have that much of about outliers Or you want to specifically now when there's a big outlier There are different kind of errors you can have like observational errors You can have random errors that modify your output They're also kind of biases So if you're looking very hard at some area have some opinions about that you try to confirm your own opinion 30 human factor while You may be looking in the wrong direction There's also very misleading ways to present data that can actually fool you or fool other people. So Yeah, Vatican City has like 2.27 Pope square kilometer, which is a correct result, but totally. Yeah bad misleading If you use a sampling profile and not profiling like every instance But do you like regular sampling you can have like sampling errors? Nicholas channel theorem is a fun thing if you've broken with images or any kind of other sampling or any kind of electronics and There are multiple papers on the topic Love that one. It's very fun to read producing run data without doing anything obviously wrong This is a very fun paper that claims like stuff that went wrong because people they're looking the wrong way and Computers are very very noisy. So this is one second of my laptop doing nothing and this Well, well lots of going on although it's doing actually nothing in the background So CPUs power states etc. So Victor's dinners block explains how you have to configure and reboot and set up your kernel and aerobatic system To make sure that you remove some of the noise for some of the CPUs and get like rid of RQ Handlers and balancers or whatever Other things is we had a very fun back a while ago They're depending on your environment how the length of like your host name or how much Environment variables you have in your system changes the way how memory is allocated and if you go over the Threshold then you may suddenly go from just a couple of mem app calls to a lot of M-mapping and unmapping of the memory of Pages that can change your performance a lot It's just took us ages to figure that out So let's profile And very easy case. So the first thing I'm going to show is reading a file And the simple thing you can do in Python is just to take the time do something take the time again While there are multiple issues with that kind of approach You're missing a fun talk and the other slot like what a day has 24 hours plus minus one Why if you have time zone switches if you have like a clock show that changing you have to use a clock source To do profiling that does not change on your Surrounding so there this clock source. I'm using here a bad one. So if I do profiling like on These t-switch you get like takes our extra or I get negative results for that. So It's one of the caveats. You should Mention as you take care of So some of the example I'm using the next one is just a very simple shell Thing is doing cat things. I'm using Python to open read from file and some of the more advanced Things I'm using HTTPS connection with requests because requests It's until it most of you know it does a lot of things. So it does like network operations file operations It does something with SSL open SSL TLS encryption and a lot of things So it's it shows lots of different areas where you can get very surprising results so section one P trace P trace is very old Feature from the old Unix days soon about 1995 It's a way to X to the user space tracing and It's used by lots of tooling you may not so if you use the new debugger to debug a C program if you use S trace all trades if you do Code coverage of any kind of C library a lot of libraries. You will use P trace more like and P trace is useful, but slow and useful and send it's mostly easy to use So one example here is I'm using all trades at the library called tracer To see the big enough. Oh perfect To see what if I do requests? I want to see All the rivals or all function called starting with SSL CTX Something at any library that's loaded. So that's the at sign after that is the library That shows me different function calls I'm getting which libraries that's all the pipe as l model the internal dash SSL underscore SSL and there are a couple of call to see which memory addresses are called and the results Return result on the right side what very helpful But so you can see if for example, I want to investigate if you've programs calling especially function at all It's rather nice for that. You can also do something like count how many memory allocations you do So I'm running two process and two different shells So and get the pit then I use L trace to trace melloc realloc and free at any library attention to that pit I run requests call and I get like how many allocations I get and Free calls I get but one downside from ptrace is it's slow So that one took instead of like half a second or a very slow social network like three No, they don't force things. So the overhead is extremely high because it Altra test to jump back and forth between colon space and user space a lot Similar to will is the tall s trace where you can investigate system calls and developed by Paul Kranburg in 1991 and now maintain but image 11 and so the logo of S trace is an ostrich Why an ostrich? Well, if you know Dutch or maybe German it Strauss It's the name of the bird so in German or in Netherlands. He's Dutch So that's Strauss and with s trace you do system call tracing. So what's What's a system called tracing? Oh? Does load no doesn't load. Oh, is it back in my my? She okay, that's supposed to be a circle of the different rings of a CPU You see a bit of the circle so it's round because a way how more than operating systems work is that all Processes running user space and user space is not allowed directly do anything with hardware even like memories virtualized access to any kind of hardware calls Abstracted by the colonel you have to tell the colonel Please open that file for me or please do something send something for me on the network device And this is a done by a syscall So you call a feature in the colonel the colonel does some verification and then talks for you to the Operating system and goes back and this is called a syscall and any time you do a syscall You have to do context switch so the colonel has to save the user space state Set up his colonel space state on the CPU do something and go back and that takes a lot of time Which you can't see in here. Well a work guess is a day So it's tracing like you one thing is make open a file So you want to like cats this at CEO's That release file and see which files are actually opened by care in that way and you see like Nothing. Well, it's bad Strange weird tracing open but open is the system called to open a file still is no results. It's peculiar, so let's just look for all So it's called made and you see how it doesn't call open it called something called open at or open at So the colonel does not have guys one syscall for specific tasks They open a like a family of syscall to do related things and GPC decided to move away from the old open syscall because not available on all operating systems and CPU architectures But use open AT a while ago So one thing if you want to stress like open calls is to use like this regular expression or even easier they're like a Multiple families of things I will explain in a minute And this approach ultimately the regular expression is a bit bad if you like stat instead collect get status of a file like file size and permission They are like a plentitude of differences calls Which may or may not be available or may or may not give you the correct results And you do see does correct thing that you need to actually track them all so easier way to do that Comes next but first. Yeah First look at how the stress open at call works So if it I open at Strays that you see like multiple calls and the result on the right side is the low-level file descriptor, which is in this example I was three because Program opens a file read something closes it and then the current reuse the same file descriptor number Or I can do something else and rather new feature is dash capital P to trace all activity on one file You see it's doing it's actually doing real like because it's a simulink and then do some stat calls read something and finally closes the file So this is a rather nifty tool to see What operations a process does? Again, there are multiple helper classes. So you want anything with a file you can use Person file percent desk is anything with a file descriptor this we use sockets and file operations Network operation of different family class you can help and their Other multiple help us to get like more output and have stress give you a more detailed analysis of what's going on for example Tracing all file access by writing a program This is a request call that tries to load some CA certs and are present So I use that feature a lot to investigate why something doesn't work over expect that this one configuration mistake I had in one of my systems Another thing is to see network activity So if you do like a network call the first thing you always do is DNS log up You see it's open a socket to a net dgram. That's UDP socket does something on port 43 53 Looks for Python and then gets back an IP address and then next one it connects to that IP address and does a request and With the right options, you see actually what's going on the internal data structures Do it's the straight includes also nice way to learn more about how operating systems and Gdpc in kernel works a Cool feature for any kind of tester is something called sis called tampering can actually modify and play around and Disturb how sis called work for example? I inject a An error into the socket sis call it opens a new socket and say, okay EM file is not Is a error number as an Anna on a pit and do something and if I do a request then Okay DNS look up doesn't work because the first socket call doing in DNS lock is just intercept it and Get an error. I can also do something like okay. I don't want to just intercept the first one I want to accept the second and any following one So that's the when equals to plus and now the DNS lookout works But the first connection fails because I can't open a file as a too many open follow scripted. That's the EM file error number or Perhaps all you want to slow down like some operations reading writing to a file slow down some kind of network operations You can do something to slow that down with s trace to you can add a delay either in the beginning or in the exit of a system call and that slows down like copying from Def zero to def null from three dot two gigabytes a second to just about ten megabytes a second Just by slowing it down a bit Our thing is for example, you want to allow us a program that removes temp file. So let's Just disable the unlink call on like is the internal name to remove a name from a file descriptor From a file handle on disk. So let's remove and in Unix speak and Yeah So you see that it's injected and the file is still there But the program doesn't get an error on so it doesn't fail my perspective of program, but it doesn't do anything. So it's just Return volume zero and yeah so Verdict I'll use L trace especially s trace a lot because it's easy to use for small simple tasks It's powerful and usually doesn't need only extra privileges But on the other hand it's slow and especially Ultrace does not work with any kind of modern binaries when they're Compiled with special flags. So if you have a bind now thing then there's missing some information in the header and L trace can no longer analyze and see what's happening So they was high-level tracing it's go a bit lower to actually to see what's my operating system doing? What's my colonel doing? What's my hardware doing? There are several tracing capabilities inside the colonel for different kind of tasks So a lot of tracing is for help the colonel tracing you can see what the false system is doing what your hardware drivers are doing The CPU tracing capabilities you can see what your CPU cache is doing What your memory management unit is doing handling memory? Or there's also a way to do user space tracing from the colonel space So P trace is very slow because P trace at any time you do something has to copy the values back to user space and copy get back And copy lots of data with efficient user space tracing in colonel space You can do lots of pre-filtering and the colonel stored in an efficient ring buffer and then have another process extract the ring buffer With the pre-filtered or pre aggregated results to a file. That's very very efficient different And yeah, what I mentioned before It's a fun way to learn more about how actually the colonel works different data sources are colonel probes and user space probes K-probes you probes Different event handlers the colonel define several events if you have several events some kind of chips on your Motherboard made emit events that are handled by the colonel and offered to you and they're different have user space things UCT I will explain later on with some examples in Python Python. Yeah K-probes U-probes I would cannot probes you can see almost everything happening inside the colonel and user space also almost everything things you can't inject or Intercept is anything. It's statically internally optimized see function or Internalized see functions. They are optimized away by the compiler and they're no longer available. But the rest. Yeah and performance counter this is a small small small part of which kind of performance counters you actually have I think the pages usually like Like 20 pages or so my screen I have a big screen. So it's a lot. So something you can do is like Yeah, these are almost 1,000 I heard different events I have on my system So and colonel trace events you can see It's here. For example, I'm Listening to Cfc 802 1 1 that's the standard for wireless network cards and I get the base station Frames and bet get base station Packages so I see what my wireless network card is doing when connecting to a new base station and you see different frequencies you see activities to see that in the end it's connecting to the physical hardware to Ben 1 and frequency 518 0 and Mac number and other stuff and these are Two of the events you can see if you want to know what your system is doing fun tool so The advanced tools I'm going the mention. I will not cover all of these tools I'm calling quickly F trace because F trace foundation lots of the other tooling using a function tracing in the kernel The perf tool to handle perf events BCC and extended Berkeley package filter language tools are a new way to write kernel programs And these days the curl has a virtual machine with a jit that you can run ebpf programs in system tap the last tool explain and there's several more tools so like LTT and G which is a cool tool but developed by the University of Montreal Yeah And de-trace and system tabs. So if you look into the Python documentation on the instrumentation System tab is one way to do de-tracing on Linux of original developer son F trace the function tracer You can do function tracing on a system that just has a kernel and a busy box because you only need a Very low-level shell commands to do that And the rest you can do with a virtual file system So just one example is I want to issue on one system that stored data on Fs I want to see which kind of current calls Just a simple Python program does it opens the fall and read something and You see right there. I have a function graph attached to any kind of NFS kernel function This is the call stack inside the corner of the colonel does to read something from NFS store Or a different representation is I want to see because I noticed that getting permissions from NFS was very slow So give me anything NFS permission related and give me the cold stack of that You see here. It does actually two different open calls First is does a check using new stat and something and The second one it just opens the actual file. See at the end this do this open or is this called 64 That's the entry point where the user space calls into colonel space And then the colonel space does permission checks if you're she allowed to open the file The issue we are heading here is that the meter data cache for permissions had some issues and didn't cash The permission is correct way Perf counting on Linux as I mentioned before Different ways to do that in most cases you can do that as an unprimvolved user You can also the tooling has high-level tooling to look into Python and Java not just and PHP and whatever else are using One thing It's very fun. So How What does my CPU do when I compile CPython on my system? So I hear you improve getting stats and calling the command make dash J So do you parallel builds of CPython? You see like how many contacts which they got how many CPU instructions it took to compile CPython on my laptop How often the level one level two cache would utilize? Very nice way to see if your algorithm so if you're in data science You want to have a algorithm that uses the CPU case is very efficiently and you see you have some of issue there well, or How good compiling CPython uses the turbo utilization so these days Computers CPUs have to boost that allows you to barely handle one physical CPU cores to virtual CPU cores and In theory you can a realization of two which would be would mean that both cores Visual cores would be perfectly used one dot seven is a very good ratio So there are a lot of ways to do that. You can also do user space probing So I used a while ago the example alt-rise Perfects a bit different first you have to define your probing points Which you want to get and then you can get statistics about that how often the differences calls are called and So the plain one without any tracing took my slow hotel and broke like bit more than half a second the ultra is very and almost 3.5 three at four seconds and With a perf. It's just a bit slower. No a bit more than one millisecond slower than the virtual one so that's much more efficient and To get like proof results I'll using now another approach to get a call graph From a request call so first you have to record what you're doing then you have to do reporting annotating and Finally you can a pirate through a script and create something called a flame graph the graph I showed before And if you do that first calling Python you get something like that She bit hard to read And it also it contains both things happening in requests, but also all the operations happening While starting Python and shutting Python down. It's only counting User space time so it doesn't not see anything time. It's happened in colonel space Like doing network transactions. So we want to look closer. Just want to know what requests does internally Using the similar process before getting the pit Running proof on that pit. Just do the one request then I control press control C So that do the flame graph now you see That graph now here again the box You look at the very low you see something called x5 or 9 store load locations So that calls wasting almost 40 percent Locating loading and parsing the root CA certs to validate requests So if you do a cell connection, you have to load like root CA's trust anchors and that loading takes very very long time because It does a lot of internal operations And if you do requests dot get in a loop you always have to do the same operations load CA certs from the disk Do some operations put into special memory structures validate them, etc. So the correct way is use a session or reuse SSL context to load only the root CA's one time And you're fine It was something I just figured out like a week ago when I updated the slides from Using PHP examples used curl and PHP my original slides from the web developer conference to Python other advanced tools To look deeper into the colon a bit easier to use than doing raw Function tracing as the BCC compiler collection, which I like a lot It's a way to write Something Python mix with C code which will then generate ebpf programs and upload them into your kernel and do some kind of rations and This BCC collection is a collection of a lot of a lot of tools. This is slightly older Explanation and listing of different tools and use So things you see around except for the C Java node by your PHP Python Ruby thing These are all tools that are already available and ready to use in the example directory of BCC for example one tool is X for SF slow operations tool, which shows you which Processes on your computer take a lot of time doing something on the X for file system so this is For me best does something so that's a baller control are using KDE baller CTL is like the index database that indexes Files on your file system There's also a mud storage. It's part of Mozilla Firefox to store cookies and yeah So these are some process to take a lot of time on my X for files in my home directory Or and get TCP connections, but filter them by user So with TCP dumps you can just get all TCP connections But you don't see the user ID and this TCP connect program can filter Connection like by user ID or other things that available in the colon space not but not available to tools like TCP dump or Well, how about we break all SSL encryption with SSL sniff using requests call using accepting calling identity Because I don't want to have like gzip compression compression makes it hard to read and Run the program and well, I get like clear text results So that one uses user space probes to hook into open SSL Before SSL write encrypt stator or after as a read decrypt stator Just and then it dumps all the traffic and that works for all processes on the computer so that That one only attaches to one pit Theory you can run it at the root on it on your system It will dump all TLS as a encrypted traffic to a file or How about you want to see which files are open so you can run that small script is BPF trace and to and accept all just enter open AT calls and just dump the command name of the PID and the file open It just will print lots of lots of output on your screen all file activity on your computer Or how about you want to know How memory allocations are handled so this is a histogram of all sizes of memory allocations for a quest call So you see on the left side the ranges so one byte or two to four bytes allocated like six hundred sixty one times and etc and Well, these are very cool tools to just a look very quickly into Your processor gives you the idea what may go wrong and The most powerful tool I currently know of is system tab System tab is a right way to write kernel models that does system interception and profiling and including using a user space defined probes So use the keys Away where a program can tell system tab where there's something that could be intercepted or done So Python offers multiple user space probes like function entry function return GCC done to see what the garbage collector is doing Imports or different line activities and the last one I added for three eight is for auditing hooks PHP is even more Once and if you look into Java, they're going a bit overboard 521 the time I wrote the initial version of that Talk like half a year ago probably more now and if you do Tracing was a system tab or s tab command. They say one problem So I give my leper very secure and which kind of Prevents me from using system tab because system tab creates a kernel module and tries to load into the kernel If you run your kernel securely with secure boot, then you're not allowed to inject any Random unsigned kernel modules. So the first thing you have to do is reboot your computer and Disable secure boot or figure out how to do kernel signing on your laptop with a mock key So let's trace Python Let's see how you can you write your first s tab program to trace what's happening inside Python So we have to define a pro point Attach the probe around to a process which is actually not necessarily a process name maybe sometimes a library name and then we use a marker and the markers always double under Score thunder for some reasons over the entry point has to singled under so It gets multiple arguments the first one takes three string pointers You have to use user string to convert the remodel name We didn't like the current time and using the current time and the Threat identifier to store them in a kind of hash map and they're print out some stuff and incrementing the depth And the other way around so I have a second one that goes on a fine load done Which gets the model name but also information one the import successful or not keeping the time and printing some stuff and just to run your first S tab program I need root permissions to inject the kernel model for good reasons So I using the import s tab program and run this Python pass You see the different imports including nested imports You see like the encodings model loads codecs or the site model tries to load site customized user customized and the timestamps and when it's done so and They talked yesterday about gil or no gil Her I think it's just over there somewhere he added additional user space probes use dts to investigate when the jill is allocated Or jill is acquired released or when somebody tries to get the jill and this is something I may add to actually the next version of Python. You can see when there's any kind of congestion on The jill it's a cool thing. So verdict colonel space loser space tracing tracing, sorry I think you can get a lot of detail information Which is also one of the issues you get so much information that may get overwhelmed is very fast Mostly efficient. The overhead is like it like 10 percent 15 percent 20 percent depending what you're doing You can get extremely detailed information what your hardware sufferers doing There's a variety of already pre-built tooling, but yeah The learning curve can be very steep often playing around with that for a year now. It's still not very good at it And yeah, and also if you do the wrong way So if you do something like enable dumping all call stacks for all call function You turn your big server into a very very slow computer or even slower than that one Yeah, so in my own opinion, and this is actually I watched this army knife before I knew they were going to your Python So that's from my first version So S trace and the BPF trace a very tool nice tools very quick hacks and quick approaches VCC is very cool. If you can use the pre-built tools For writing new tools. It's not that hard. You need to know a bit of Python a bit of sea because The mix is very wild. You use like ginger templates with C code inside Python code to do something generate new code. So it's a bit like siphon, but for kernel models Perf is Great, if you want to go very very low level I don't have I may have time to show you a video what we did in see Python to investigate an issue And the long ad operation to add two numbers. I think it's all enough time system tab is Very interesting if you use like user space defined probing And there's cooling approach to replace some of the C code actually BPF code So then you no longer have to run scary kernel models inside your car I'll just run EPPF program inside the jitter of the car was a bit more saner and safer F trace is useful either if you're just booting up the system that know it has no user space tooling Yet or for all the kernels and again EPF is pretty the future You won't learn more Brandon Greg's website. It's just the beginning of anything ready to tracing. He's just fantastic EPF and I supervisor project There are multiple books on system tab that are already great There is a Has been a talk on pi base 16 by even free man You've got into more details how to extract like stack crisis in Python from colonel space and getting a bit more deeper on that topic and Can take like three minutes of questions and I While taking questions and just show you the video that okay Where's my muscular? So this I'm compiling Python running a perf on that and Going deep into like which CPU instructions like executed so run and Anybody any questions any questions anybody has any questions? Thank you Christian Any questions, please come to the microphones in front? Okay, no questions. Oh, there's somebody coming. Okay. Hello So when I was using native code it was very interesting to use as choose trace and similar tools, but for interpreted languages I thought it was a bit more difficult because it's You see all the code which the interpreter is actually doing and I found it hard to actually associate my code with the traces Yes, that's one issue if you cross language boundaries like from native C code or native code on on Interpreter code or between I used to do like Java and Python mix up on the same process or dot net and Python the same Process did get harder. So there are ways to extract like stack traces back traces of calls using these tooling so gdb Has a lot of very all about scripting to extract information and this is something like a call to action if you're interested to do more system tab the even freeman. Yeah, even freeman he wrote or is some proof of concept tooling and Instagram Facebook They are the one they usually want to be with the first implementation calls to Python and they have some tooling But they're not get open sourced I hope that I can convince somebody at Instagram that it may be released some of the tooling which they use to Optimize the Instagram web services for doing Python 3.7. I think that would be cool Again, yeah, it's a big issue That's why you Need extra work on that. I agree Okay, so one very quick question maybe Okay. Hi Can we use these tools in the car environment and can we prepare the document environment to trigger them remotely for example? Talker so Yes, and now you if you're able to Depending with tools you have so as price should work if you don't need to Attention to a different PID some of the other tooling like you probably don't want to allow your docker demon to modify your kernel It so but if you have access to the base system So the system that runs your container environment you can run there as a privileged user Because containers are just processes in a different namespace on the same computer that would work So like the low-level colonizing tool is probably not for security reasons a Docker or any other container platform restricts schools firstly the P trace attach and Conloading So schools, but again use base system that would work Okay, okay. Thanks. You're welcome. You have any more questions. I will be here like we have yeah, sorry any end of the week So thank you again


Welcome back to our lecture series math 42-30 abstract algebra 2 for students at Southern Utah University. As usual, I'll be a professor today, Dr. Angela Seline. Alas, we come to the last episode in this lecture series, lecture 39, for which we're going to continue developing our notion of a Boolean algebra. In this video, I want to prove the so-called De Morgan laws of Boolean algebra. These are properties we might know from logic or we might know from set theory, but as those are both examples of Boolean algebras, this is actually a property that extends to the general Boolean algebra setting. So imagine B is a Boolean algebra and let X and Y be elements of said Boolean algebra. Then the following is true. If we take X join Y complement, that is we complement the whole thing. This is equal to X complement, meet Y complement. And similarly, if we take X meet Y and the complement of that whole thing, that is equal to X complement join Y complement. In particular, when you take complements of an operation of a Boolean algebra, you are going to take the complements of the individual elements, but the operation will switch from meet to join and or excuse me, from join to meet and meet to join in this situation. Now, because of the principle of duality, it suffices for us to prove one of these statements. We only have to prove the first one that X join Y complement is equal to X complement join Y complement because duality will take care of the other one right here. Now, how are you going to do this? What we're going to do is because previously we've shown that in a Boolean algebra, complements are unique. There's only one complement given an element. So the complement for X join Y is uniquely determined. So therefore, if X complement meet Y complement, walks like a complement, and quacks like a complement, that makes it the complement of X join Y. So that's exactly what we're going to do. We're going to take X join Y and we're going to join it with X complement meet Y complement. So if these are in fact complements, an element join its complement, that should equal the maximum element one. And then down below, we're going to show that X join Y meet X complement meet Y that this is going to equal zero in that situation because that's exactly what complements are going to do. So we're going to prove that this element acts like the complement. And like I said, the second equality follows by duality. So let's start with the first one here. X join Y join X complement meet Y complement. We want to show that this thing is equal to one. Okay, so what can we do with this thing? Well, because we have a join and a join, we can use associativity and we can rewrite this as X join Y join X complement meet Y complement like so. For which then the next thing is since we have a join and a meet, we can distribute the join Y across the meet. And so this is going to give us Y join X complement meet Y join Y complement. But wait a second, we know that Y complement is the complement of Y. Clearly it's in the name. So Y join Y complement that's equal to one. And remember, one is the identity for the meet operation. So one meet anything is always that thing. So this part is just going to just vanish off. And we're left with now X join Y join X complement like so. All right, so now we are commutative. So we can swap the order of those. So becomes X join X complement join Y join is associative. So we can rewrite this as X join X complement join Y. And just like above, since X and X complement are complements of each other, X join X complement is equal to one. For which as one is the dominant element of join one join anything is always equal to one. So we get a one right here. And this proves the first statement that if you take X join Y and you join it with its potential complement, you actually get one, which is what you should get for a complement. Now that's not enough. We have to go the other direction. We have to show that X join Y when you meet it with its, you know, its supposed complement, this candidate that that's going to equal zero. And so we're going to do that right here now. This one's a little bit shorter, right? So to consider this, we're going to take X join Y meet X complement join Y complement. Well, the first thing we're going to do is that meet is commutative. So swap the order like so. Okay, then the next thing we're going to do is use the fact that the double complement is the original element. We prove previously that X double complement is equal to X and same things can be said for Y. So X is equal to X double complement and Y is equal to Y double complement like so. And so I want to remind us about the statement we had just proven, right? We have just proven that A join B join A complement meet B complement is equal to one. So that's a statement we had just proven. It's not along on the screen here. Because this statement is true, its dual statement has to likewise be true. The dual statement would be A meet B meet. In this case, A complement join B complement. And that's going to equal zero in that situation. Now if you use the substitution that A equals X complement and B equals Y complement, we're exactly in this situation right here, the left hand side, we have X complement meet Y complement meet X double complement join Y double complement. That statement by the dual of the previous one is thus equal to zero like so. And so that then gives us that direction much, much shorter we'll benefit from the statement we had before. So this shows that X complement join excuse me, X complement meet Y complement is in fact a complement for X join Y as complements are unique. That tells us that this must be the complement of X join Y. So we complete the statement right here. And then like I mentioned, the second statement is actually the dual of the first statement. And so that then proves the De Morgan laws for any Boolean algebra.


Good morning. So, we will start slowly. We hope that about in 5, 10 minutes all the centers will join us and all the participants will be here. What we will do is to give you a very broad overview of the course which you have already seen, but maybe just a few minutes till we wait for others to join ok. So, this course is as you know being held in two modes. It is a blended mode of online and in a face to face. So, we have already completed the online which was done in IIT Bombay X in Moodle and now we have the face to face workshop will be spread out over next few days. So, you have seen this before. So, this course will have the two portions which is the online one. So, all of you have taken viewed lectures, taken quizzes in the MOOC platform known as IIT Bombay X and you also have submitted lot of assignments which were evaluated by your in Moodle platform. So, this portion of the course is done and now we come to this face to face portion where you have come to your local centers and we will have faculty from IIT Bombay here who will run through various aspects of what you learnt in the online portion. So, this is essentially what you can call as a flip classroom. So, what you have already done will be reviewed now and you will have some assignments which are tutorials live conducted by our faculty from here. So, what we have now is we are connected with Bombay here and we have centers about 119 centers throughout the country most of them from Maharashtra and Tamil Nadu and we have a few in the north and some in the east. So, all these centers are connected through this A-view platform and they will all be viewing along with you this session that is being conducted here and some of you might have already seen this platform. Now in this platform what it allows you is to listen to what is happening here live and it also gives you an opportunity to interact. So, what you what will happen is your remote center coordinator if you have any questions you please let them know and they will raise the hand. So, raise the hand is a software button there. So, we will come to know which of the center is having some clarifications to ask and then we will stream that video live and then we will respond to those questions. So, this will happen towards the after we begin the classes this session is predominantly going to be a tutorial kind of activity where we will be reviewing the concepts and then giving you small assignments. So, how do we see that you could use this course in your own curriculum. So, the videos that you have already seen in IIT Bombay X will be made available in IIT Bombay X students to register. We will let you know about the modalities of how to enroll your students later next semester, but what will happen is exactly as what you have done in this course. So, the students can register for IIT Bombay X and then view the online videos, complete self assessments online and then so all this they can do at their home or hostel. Now, once they have been prepared with some basic material and then they come to your classes and you can conduct tutorial sessions just as we are conducting tutorial sessions now. So, just as we did a flip classroom for this course you will be doing a flip classroom for your own course. Students of your college to take it in a more formal way you might need approvals from your own academic sections or deans or principles and you also write to us if you want to include any particular topic or we will have a particular schedule of activities. So, if there is some small changes required we could work on that and then you need to enable some ways in which students can enroll in this course. So, with that broad introduction I will quickly introduce the team here who have been tirelessly working behind the scenes to get you this course. First to my left is Professor Viren Sethi. He is from Environmental Sciences and is very closely involved in this course. We have a similar course of communication skills running in IIT Bombay and most of us who have whom we have seen in video lectures are all involved in this course. That is Professor Parthasaradhi and Ambarish Kunwar, Professor Lina Jha, Professor Fatak. This is the team from the workshop Mahendra Kanan. Can you quickly tell your names and introduce yourself? The workshop team is led by Dr. Mukta Adre and the team members are Ajay, Sarika, Archana, Kishore and coming to Anshweta Shinde. That is Dr. Kalpana Kanan and Nazia that is Varsha and Urmila. They are some of the content. The E studio team is led by Sajjan. And the other team members are Pradeep Patil, Shekhar Patil. He is a cameraman. Santosh Sushant here. So Ajay Nair, most of you would have seen his answers. He has been very actively participating in helping the conduct of the course. Shweta and Rashma. Okay. So we just give a couple of minutes. If anybody has questions from there, we will just see if the audio is working well in your side. If anybody has a question, can you please ask your report center coordinator to raise the hand? Yeah, okay. We need some inputs in elevator switch actually. We will take each of those topics that we dealt in IIT Bombay in detail. Yeah, we go ahead. Okay, sir. The timetable has been already shared with you, but we will again discuss it later today. Amal Jyoti. Good morning. Morning, sir. All right. So I just want to welcome all of you.  So you can say hello to all 117 other centers. Say hello. Everybody say hello. Everybody. Not just the person with the microphone. Everybody. Okay. Excellent. Excellent. So we want to welcome you to the course. Welcome to the course. Thank you, sir. Yeah. And we want to... So how many of you knew each other before you came today? Yes. Only the first two. What about the remaining eight people over there? All right. Okay. So that may be the case in most of the centers that people are coming together for the first time.  That's the intention of this course. So I want to welcome you to that mission. Savita Engineering. Good morning. Very good. Very good. I like that. All right. Very good. So how many of you knew each other before you came today together? Okay. Some people. Okay. Good. So one of the things we want to do is have you be present to the fact that the greatest resource that you have is right there in the room with you. And all we are doing from here is some kind of a facilitation so that a large number of communities across India can start working together. Okay. So you really need to be working with each other. It's an interactive course. So a lot of the work will happen with each other. And all we will do from here is try and enable whatever can be done. Is that okay? All right. So would you please clap for each other in the room?  Okay. Thank you very much. Let's go to the next. St. Joseph College. Hello. Good morning. Welcome. Welcome to the course. Okay. All right. Very good. Thank you. Thank you for being there. And please begin to do the work with each other because the resources are available in the room that you are. Okay. So please be available and please make others available to yourself as a resource. Thank you. Please sit down. Thank you. Okay. Dronacharya College of Engineering. Good morning. All right. Yes. Please raise your hand and say hi. Hi. Okay. Welcome. Would the coordinator like to say something please? Sir, I director, Professor Bhaggai is here today. He would like to welcome the other participant from all of the centers for this technical workshop, sir. Good morning, sir. I am Dr. S. K. Bhaggai, Director of Dronacharya College of Engineering, later, Noida. So here, 40 participants have come from various colleges and they are attending this course. Your course has really made them good in the future career. Thank you very much. Yeah. Dr. Bhaggai, thank you. And, you know, in saying thank you to you, I just want to thank all the centers and the support that is required for conducting such a course. So I just want you to know that we appreciate your partnership in this effort. So thank you very much and look forward to your participation as well. Thank you. All right. IPS Academy Indoor. Okay. Please wave your hand. Wave your hand, everybody. So we know you can hear us and see us. Okay. Welcome. Would the coordinator like to say something? Good morning, sir. Okay. How many people in your center? Hello. Sir, total time and candidate in my center. Welcome to everybody. Okay. Welcome. Okay. This is a good way to communicate. Okay. So we know that we got, okay, very good. Excellent. Thank you. Thank you very much. All right. We've got about 10 minutes before we break. So what I'd like you to do now in this 10 minutes, I'll just tell you how this next five days is lined up. So while that is there, and this is the, what I'd like you to do now is to actually introduce yourself to others in the classroom. So most of you are probably from the same college, but there are many more people who have come from other colleges. So I'd like you to take the next five minutes to please introduce yourself to others in the classroom and also form a small group. So most of the activities that we will be doing in this course of tutorial of the face-to-face workshop will be a group activity, a small group activity, and then you will present it to the whole of the classroom. So please take the next five minutes to introduce yourself to others whom you don't know in the class. I hope you're introducing yourself. How many are from, not from your college, Gyanamani College? Where is this? Gyanamani. Everyone from our colleges. Okay, very good. Thakur College. Sir, we have around five faculty members from outside, outside Thakur College of Engineering. Very nice. So I hope they're all comfortable there. So get used to your colleagues in Thakur College. So you'll all be interacting more in the next five days. Thank you very much. VNIT Nakhpur. Okay, there's only two of you there. Are any more expected in Vishweshwarya? There were four participants registered, but only one has reported, sir. Okay, thank you very much. Tyagaraja College. How many from outside the college, Tyagaraja? Good morning, sir. I'm Rajaram from Tyagaraja College of Engineering. Nice to meet you, sir. We have 29 participants from Tyagaraja College of Engineering and we have six people from outside. Six. Okay, thank you very much. So let me just give you an overview of the schedule. So this is the broad overview you might have already seen. So the lecture sessions start at 9.30 and end at 4.15. And each is a 1.5-hour session. And there's a small break of five minutes between two sessions, one here and one here. And we also have a 45-minute lunch break. All the sessions will start on time. So I'll just go through the topics once more. So we've had the welcome session now. We'll have two sessions next on the scientific methodology. Then in the late afternoon, we'll have one on listening. This will be followed the next day also by another exercise in listening. We then move on to reading. So which will, the both the scientific methods, reading will all be based on the activity that you have done in a model. Then we'll have a discussion on ethics and authorship, data presentation, abstract writing, elevate approach and summary writing. This all with respect to writing. We have writing is the most dominant feature here. And then that will be followed by presentation, slides for presentation, group discussion, interviews on Friday. And then on gender and diversity issues in STEM education as well as in workplace communication. Then on the last and final day, we'll have two sessions on presentation skills. We'll have one session for you to raise questions on the session on the course in general. And we'll close around three o'clock on Saturday, this coming Saturday. So the way the activities have been designed here, most of the activities will be on the following basis. Firstly, what we'll do is the lecturers whom you have seen in IIT BombayX video, they'll all be here. And they will quickly recollect the important aspects of the lecture that they have given you. It will not be a full lecture, it will be a few points, important points from the lecture. And then that will give you an opportunity to initiate discussions on some questions or clarifications that you have had. And then we'll start the tutorial activity. So the tutorial activity will be done in a mode called as the think-par-share. I'll tell a little more about it. So once a small activity is done, and then we'll still continue by further questions and answers. Since you have already carried out a small activity, you will be able to ask and clarify more doubts. And in certain cases where it's applicable, we'll also give you hints on how to handle large classes for that particular assignment. So for example, the most of the things that we are doing now are exactly the way we do for our own students and we expect that you will do for your own students. So we'll also share some tips on how we can conduct large class activities. So what is think-par-share? Let me just tell you what this think-par-share is. So what will be given is first you'll be posed a problem and you have to think about it and write down the answer to it on a piece of paper.  So about a few minutes, a couple of minutes will be given for you to think about it and respond. So you will respond first yourself independently. This will be followed by what is known as the pair. So you have to please sit next to a neighbor with whom you're going to share what you have written and also listen to what they have to tell you. So this will help you improve the answer both of you together. You will improve the answer, you'll be able to improve the answer, you might be able to clarify certain points that you have missed or your partner has missed. And then we will randomly call a center to present it to the bigger classroom, not just to the classroom for your own center but to a bigger classroom. Now as you know the bigger classroom, there's only one center that can be relayed simultaneously. So we will pick a couple of centers at random but you could also present the workshop coordinators in each center can request a couple of people to present it to your own class. In case there is an audio problem connecting to us, you can ask your participants to present locally and also listen to the presentations that are given across all the centers.  So while that is there and this is the what I'd like you to do now is to actually introduce yourself to others in the classroom. So most of you are probably from the same college but there are many more people who have come from other colleges. So I'd like you to take the next 5 minutes to please introduce yourself to others in the classroom and also form a small group. So most of the activities that we will be doing in this course of tutorial of the face to face workshop will be a group activity, a small group activity and then you will present it to the whole of the classroom. So please take the next 5 minutes to introduce yourself to others whom you don't know in the class. I hope you are introducing yourself. How many are from not from your college, Goundamani college, where is this? Okay, very good. Thakur college? Sir, we have around 5 faculty member from outside outside Thakur College of Engineering. Very nice. So I hope they're all comfortable there. So get used to your colleagues in Thakur College. So you'll all be interacting more in the next 5 days. Thank you very much. VNIT Nakhpur. Okay, there are only 2 of you there. Are any more expected in Vishweshwarya? There were 4 participants registered, but only one has reported sir. Okay, thank you very much. Tyagaraja college? How many from outside the college? Tyagaraja? Good morning sir. I am Rajahara from Tyagaraja College of Engineering. Nice to meet you sir. We have 29 participants from Tyagaraja College of Engineering and we have 6 people from outside. 6. Okay, thank you very much. So let me just give you an overview of the schedule. So this is the broad overview you might have already seen. So the lecture sessions start at 9.30 and end at 4.15 and each is a 1.5 hour session and there's a small break of 5 minutes between 2 sessions, one here and one here and we also have a 45 minute lunch break. All the sessions will start on time. So I'll just go through the topics once more. So we've had the welcome session now. We'll have 2 sessions next on the scientific methodology. Then in the late afternoon we'll have one on listening. This will be followed the next day also by another exercise in listening. We then move on to reading. So which will both the scientific methods reading will all be based on the activity that you have done in a model. Then we'll have a discussion on ethics and authorship, data presentation, abstract writing, elevate approach and summary writing. This all with respect to writing. We have writing with the most dominant feature here and then that will be followed by presentation, slides for presentation, group discussion, interviews on Friday and then on gender and diversity issues in STEM education as well as in workplace communication. Then on the last and final day we'll have two sessions on presentation skills. We'll have one session for you to raise questions on the session on the course in general and we'll close around 3 o'clock on Saturday, this coming Saturday. So the way the activities have been designed here, most of the activities will be on the following basis. Firstly, what we'll do is the lecturers whom you have seen in IIT Bombay X video, they'll all be here and they will quickly recollect the important aspects of the lecture that they have given you. It will not be a full lecture, it will be a few points, important points from the lecture and then that will give you an opportunity to initiate discussions on some questions or clarifications that you have had. And then we'll start the tutorial activity. So the tutorial activity will be done in a mode called as the think-par-share, I'll tell a little more about it. So once a small activity is done and then we'll still continue by further questions and answers. Since you have already carried out a small activity, you'll be able to ask and clarify more doubts and in certain cases where it's applicable, we'll also give you hints on how to handle large classes for that particular assignment. So for example, the most of the things that we are doing now are exactly the way we do for our own students and we expect that you will do for your own students. So we'll also share some tips on how we can conduct large class activities. So what is think-par-share? Let me just tell you what this think-par-share is. So what will be given is first you'll be posed a problem and you have to think about it and write down the answer to it on a piece of paper.  So about a few minutes, a couple of minutes will be given for you to think about it and respond. So you will respond first yourself independently. This will be followed by what is known as the pair. So you have to please sit next to a neighbour with whom you're going to share what you have written and also listen to what they have to tell you. So this will help you improve the answer, both of you together. You will improve the answer, you'll be able to improve the answer. You might be able to clarify certain points that you have missed or your partner has missed and then we will randomly call a centre to present it to the bigger classroom, not just to the classroom for your own centre but to a bigger classroom. Now as you know the bigger classroom there is only one centre that can be relayed simultaneously. So we will pick a couple of centres at random but you could also present the workshop coordinators in each centre can request a couple of people to present it to your own class. In case there is an audio problem connecting to us, you can ask your participants to present locally and also listen to the presentation that are given across all the centres. So that's it for now. We'll break for about 5 minutes and if you have break arranged or if there is a tea break can go and come back and assemble after 5 minutes. We'll see you in another 5 minutes. Thank you very much.