Welcome to Toffy TV, it is the instant match reaction. Manchester United 3, Everton 1. Yeah, it was a lot closer than I think a lot of people anticipated tonight. Obviously Everton went behind quite early, went back to the 5 at the back. Excuse me, not a good time to sneeze when you started. Went back to the 5 at the back and obviously went a goal behind early on but then settled down after that. Got a goal back, very fortuitous of course but Conor Coley was there. And I thought we had a nice feel to it, I thought we had a nice balance to it without really playing any decent football. We did what we did last week, we clogged up the edge of the box and then we broke and I thought we broke quite well until we got to the edge of the box until we completely ran out of ideas. It's something isn't it? It's something that at least looks like it's a plan. What we saw on Tuesday night and what we saw against Wolves, the 4-3-3 or whatever you want to call it, it just doesn't work, it doesn't create chances, it doesn't get us going on the front foot, it doesn't get our best players in the right positions.  Now listen, is he massively frustrating? Yes because 8 out of 10 times, 7 maybe at best, he chooses the wrong decision whether that be with his feet or with his head.  We saw that at the other way tonight with Rashford who I thought was brilliant again and his change of pace helped create their second goal or did create their second goal. But I think grey off Dominic Carvin-Lewan is a threat, is at least a threat. And we saw that in the second half. Obviously we don't know what to write in the first half, it did feel a little bit like if a lower division team were playing Manchester United, it was very very frantic and we were holding on for loving the money at times. But the plan was working at least the way I imagine Frank Lampard set out because it's not a fluke because we saw that last weekend in Manchester City. Come out second half and unfortunately Wobby on a counter attack again, us breaking the ball up on the edge of the box. Wobby gets really hit, his ankle bends on the table, very reminiscent of Ray Charleston's last season at Anfield Witch with Charleston said that basically he shouldn't have played a lot of games afterwards but he did because he strapped it up. But Wobby was obviously in a lot of pain and to be fair Wobby didn't have a very good game, he didn't have a very good game at all. But it looked a bad one, it looked a real bad one. Obviously with him counter attacking and then going down like that, he went off and two minutes later they've got the ball in the back of the net and it's a good run by Marcus Rashford as I said and the way he changes pace there's not much change he can do and he put to the cross and Connor Cody really to be fair needs a shout from someone behind him, he needs someone to tell him that actually he doesn't need to stick out a foot because if he lets it go to a Kowsky he can just put his foot through it and put it into Rose Ed. He doesn't get a shout he puts a boot on it and it goes in the back of the net and that's the kind of look Evan is having at the moment and it is just one of those things, he doesn't need a shout he hasn't got eyes in the back of the head, okay yeah listen should he be sliding in that position he doesn't know what's behind him. You often look at them and go why did he do that because but then if he lets it go and someone just got a tap in someone got to say well when you do something he needs a shout from Sarkowsky, Sarkowsky is right behind him and he doesn't need to do that. They threw one up and you're thinking right here we go the floodgate will open and we brought Dominic Alvin on and again we didn't go mad we stayed in it we we kept ourselves in it they again didn't have loads of clear cut chances they didn't make loads of clear cut chances all night. Jordan picked for Dan a couple of days off long shots to deal with rather than ending up close they had a couple in the first half when it was 1-0 and 1-1 but you know nothing nothing nothing dramatic. Sorry I didn't blame Craig Cody for the tongo I blamed Sarkowsky for not giving me a shout. Dead simple, play shouldn't be sticking the foot out in the box but they also need someone to shout at them whether I beat the man behind them or the goalkeeper players don't have eyes in the back of the red and we stayed in it and very I mean listen it's a lovely move Seamus Coleman does fantastic for for the goal itself based through it already been started by by the flick by Dom I think Gray gets Gray gets wide he's a he's a toe offside and I know people go well you should you should keep yourself on side it's very difficult when it's a toe you're trying to hold your run if someone has if someone steps up while you're trying to make that run you can't check when you're ready already running can you so it's good balling don't put the final touches we think it's two two two but the minute we see minute you see the replay you know it you know it's offside and you know it's offside yeah this hoodie is a toffee TV hoodie in our shop toffee toffeeTVFC.com slash shop and it's real it's unlucky but it is offside and it there is VAR and all that what can you do in a way that sort of took the stung out of his didn't it that I mean two two with what 20 minutes to go or whatever and that really did sort of take this thing out of the game for us anyway you know we try to make some offensive subs you put Gordon only put Mach Neil on I put Sims on I really don't understand why doesn't put why didn't give Sims a chance I don't I don't think we needed I mean Gordon's out there touching Mach Neil's out there the touch I think we needed another player or front I think we needed someone we could start going long to towards the end of the game while it was still 2-1 I mean it's 2-1 till three minutes into in into injury time I don't either put Sims on and gone right Dom you got a big fella up with up with you now let's go long and let's see if you can get the knockdowns or you can get the knockdowns and put them under a little bit of pressure because they'd make defensive changes I don't understand why managers do that I understand you're looking for a better supply line to get that but I don't think this event seems good enough to be pissing about with it to be honest and in areas where Manchester United are much stronger they they're a much better counterattack inside than we are and by by by a long shot and I think we should have gone long but obviously they get they get the penalty I don't know why it's a soft pen don't get me wrong it's a soft penalty it's a soft soft penalty I'm not really sure why Ben Godfrey had already made a great tackle on Rashford I think it was I don't know why he makes the tackle the lad was going absolutely nowhere I'm not sure why putting it feels the need to put a tackle in I'm not really sure but he does it's a penalty in Rashford's dispatches 3-1 3-1 looks I don't know does it look worse than it was I don't know I I think it was a spirited display I don't think there was there was lots of quality but I thought he was a there was a it was a spirited display I think that's the way you play from now on doesn't matter who's in charge you think that's the way we play that's that's what gets the best out of our players and I don't know I should have seen a red no he shouldn't have I don't know I thought it was probably our second best player I don't know I may have had his best game in an evidence year tonight I thought he played I thought he played well thought he played really well in possession and was a real number six tonight for us listen Manchester United deserve to win can't see anything else but I think it I think it it did and it did show again that we can be competitive when we are when we are playing in that in that formation and to go to a Manchester City Manchester United in a week and give both of them a good game I think that proves that that's the way we should play is it enough now to listen the teams that we don't don't don't have to see here every now every time we do this doing all the teams rubbish you have to look for positives you have to look for what works and what doesn't work I think I think playing five or three works for us because I think the Marey Grey often often when a car balloon will work for us I really do I think his pace and dumb dumb in the in the six-yard box will work for us now if we're playing Southampton at home whoever the wingbacks are have to be high and that might mean that that might mean if when we play Southampton you don't play Sheamus Coleman who I thought was great tonight by the way I'm not having a go at him what I'm saying is you might play a Sheamus Coleman you might play an attacking wing back you might play Anthony Gordon and you might play Dwight MacNeill instead of Michelinko who I thought was terrible tonight by the way and then when you play someone away from home say Westam then you have Michelinko or whatever and then you have Sheamus Coleman back in the side because you are looking at having a five then so but I still I still think that that's the best way we play because I think it gets the Marey Grey into space it gets him into space and one thing I will say is tonight I did feel slightly sorry for Malpie tonight you know because not only does he get the assist for the goal but he made some good runs tonight and people don't give him the ball and I felt like so it's dead easy to go Malpie's rubbish blah blah blah he does make some decent runs that and don't get picked up on they really don't and so and I thought I think you know it's up to players to find them and that's gonna be a struggle in the next few weeks as well obviously would know what we what do we do could you put could you put Anthony Gordon in that position could the Corey be the answer he start to slow tonight and then once he got into it he looked he would start to pick up a little bit towards the end you know seeing a couple of people there in the comments saying well Michelinko could play as a third centre back well he could but then you've got Ben Goldfrey who's got the patience Ben Goldfrey is an athlete I don't think he's a brilliant footballer by any means I think he's an athlete but he has got patience he can't keep up with people and you've got chambers commonly completely right-sided centre we're not we're not struggling for centre backs are we but I do think I do think that this formation is what we have to keep with and if Frank Lampard is in charge next week which we don't know where there he is there's different there's course there's gonna be all kinds of rumors coming out of that because people said that you know almost if he didn't win he was gonna get the sack tonight or whatever I don't understand why it would be on that game when you you think you know you're going to wall traffic you're expecting to lose anyway and if he if we play self-harm the next week I just well we are playing self-harm the next week if he's the manager it's it's a it's a case of play shoulder tonight they're not they haven't stopped playing for and by any means players players players are the right go tonight whether you know whether the quality is there that's that's the thing isn't it that's that's the problem with them and it's quality and they have to make that up with hard work on Tuesday night we had no hard work and a lack of quality and that's that's where that's where we are at the moment so you can't fault the players tonight I think in terms of hard work it was all there and I think the game plan again was the that was the right game plan for the night like it was at City so you've got to look at those two things it's just a lack of quality but you can see I at least can see with that formation where we can get joy out of against other teams and I don't understand why the manager didn't play it against Brighton I know we were at home but Brighton are really good sad and there's no reason why we couldn't have played like that on on Tuesday night we should have played like that on Tuesday night because it doesn't just bring out it brings out I don't know just there's a little bit there's a little bit more isn't it and we play with a bit more hunger a little bit desire like the players like playing in that formation and they don't really like four three three and yeah listen we can sit here and we can talk about it not being good enough and the club having standards and all these kind of things listen the people who have the stand you who suppose of the standards in Everton football club they have no stand if they had standards they wouldn't be at Everton football club because they would have to look at their own their own their own stuff Steven Williams on the Super Chat says if Lampard's future was based on the game he shouldn't be sacked fair enough but to me that that's the that's the way we should play I think the players the players dug in and have a go they're just not good enough they're just not good enough it's as simple as that that's why we keep on crying out for new signings that's why we need signings and that's why it's on the board isn't it it's on the board now to get get Frank Lampard listen whether you want Frank Lampard they know we're out if a new manager comes in he needs new signings it does not matter those players we've got we keep on saying they're not good enough we need new signings it's on them in the next week to go and get whoever it's Frank Lampard at the moment and I'll just I'll think it's Frank Lampard till he says otherwise we've got to go and get Frank Lampard new signings because we had a few opportunities tonight when we got to the edge edge of the box and we we obviously made a mess of it so we're waiting to see we're waiting to listen I I said many a times I'm not I'm not asked whether Frank Lampard gets sacked or he doesn't get sacked for me that's not the problem they're ever football club because the problem is the people who are at the top of the club it's as simple as that if they don't bring players into whoever the manager is to strengthen this club nothing's gonna change so for me we we play this now we continue to play this not I don't think any of our there's no I don't think there's anyone in our fan base who's deluded enough to think that we can play nice attractive football and be people I think that is done I think everybody knows I think everybody knows that so so yeah we'll move on we'll wait and see listen I'll be back to do my play ratings it's disappointing what I'm the FA Cup this you got a free weekend you got a free weekend at the end of the month as well it's we're out the Cup it's another year no trophies stick that on a banner or something I don't know but wait and see wait and see what what happens now but I'll listen I'll be back in a little bit to do my play ratings make sure you check out buzzers videos as well and there you go one thing I will say the book the fans were magnificent tonight absolutely magnificent tonight in terms of you could just hear them all the way through all the way through 9,000 much much you know more noise than the Manchester United fan base so so well done well done to them in terms of that in supporting the team yeah there you go yeah I'll be back soon to do my play ratings thanks for watching and I'll catch us all in a little bit


This is awesome right here. It has the six piston brakes the wide-body fender flares We saw one at the dealership and it was narrow body and it just it didn't do it justice with this This guy's right here. If you want something special right here, this Is a nice looking through 92 Hey, is this color specific to the 50 yo, is this color specific to the 50? This is hard This is hard.  Look at the insert on that carbon fiber right there At least I think that's carbon-carbon. Look at the you have bronze stitching to match the this thing is amazing Oh Appreciate it man. This is awesome. This is awesome. Look how amazing this is guys Let me know what you think about this. This looks crazy I really like this pattern on the radio and the on this the center console and everything in the dash This is amazing right here. We have the Alcantara and leather inserts right there with the bronze stitching This is awesome This is nasty right here Yeah, that that was I did not like that that was weak Yeah, yeah, that narrow body was weak Yeah But see what's crazy is is when they went when they announced the 50th edition they only showed it in white body form So when I saw it at the dealership, I was confused. I was like, what is this? The painted shaker right here guys, that's definitely different on the 50th Usually it would come on satin black see guys the badge on the 50th edition is also different as well It's a more muted. So it's like a gray We're like the regular one would be colored with like a yellow and a red and black and stuff like that So, oh, it's numbered. That's right. It's numbered. So guys just so you guys don't know Make sure this is a real 50th edition car This is 21 out of 70 Damn, that's a low number man So just so you guys know if you guys do not see this in the 50th edition it is not real Seriously cuz you know how there's people out there that's gonna try and you know copy and fake, you know, I mean, yeah, this is great This is great right here This is the wide body 50th edition RT scapac man Hey, um These wheels are specific to the of this car, right? They're nasty it just looks like it just looks clean. It just looks clean like yeah, it just looks Yeah, it looks it just looks on it looks very classic, you know what I mean So another hell cat right here guys If you don't mind me asking know what year is this 16 16 guys you got um and what type of intake is this be woody Be woody be woody intake I'm thinking you were revving it earlier, but I wasn't around apparently the wine sounds way louder on this This is um the granite color right the granite color It's a nice car right here, man You walk around the car and show you guys real quick So what all do you have done to it? Yeah, I see a lot of mo-pars going to jay green Yeah, I see a lot of mo-pars. I might be considering it because I really do want it Yeah, I'm the destroyer great challenge right there with the lights So if you wanted to tune from jay green you got to get the Diablo And you can get a guy to get an unlocked PCM and then you go to him. Okay?


So in this next section, we've been talking a lot about biology and living cells, and so nothing grows in a vacuum, well maybe tardigrades, but in this next section, we're gonna talk about cultivating, which is making the space and bringing people into the space that enables this work to happen. So first we'll hear from Professor Orkan Telon, who's a professor at the University of Pennsylvania and also founded BioRealize, and made desktop bioreactor, which you can see outside. Then Professor Jean-Anne Dagdevren, who's a professor here, runs the conformable decoders group. She'll talk about some of her really cool work in wearable sensors and that are actually being tested on people, so bringing people into the equation through that. And Kit McDonald from Ginko BioWorks, the organism company, and then we'll conclude all of the inspiration talks with Professor David Kong, who runs the community, the director of the community biotech initiative here, also the professor for the course, How to Grow, Almost Anything. Yeah, so with that, I'd advise. Yeah, thanks for having me here. It's a pleasure to be back to MIT Media Lab. I am an alum from 10 years ago. I did my PhD in design and computation, and I'm now a professor of University of Pennsylvania. And I would like to start with saying that I like to, I work in the space of biology and design, but on a different scale. So in the morning, we have heard a lot of people talking about engineering organisms and how the organisms actually enable different capabilities, they sense, respond, store. But I come from a space of design where we work on a different scale. So I learned and study a lot of different microorganisms, but then I realized that my entry point would not be just organisms themselves, but what do we do with them when we put them into different contexts? Today, after many decades of biology research, we are coming to a place where we work with organisms either for fabricating new materials or making new kinds of applications with them in food, medicine, cosmetics, and so on. But the core thing is really how do we bring the organisms into the world of designers so that we can imagine new applications for it? We have seen the history of the media lab for decades where we work with electronics, computation, media, and now biology is in the hands of not only scientists and engineers, but also designers who are shaping the imagination of the field. So I'll walk you through a number of projects and I'll try to show you the design process of how things work in the hands of a designer. So all of this information can help us to think about new futures when we think about the global interfaces in the workshop session. So my work works on different scales, so I work with different materials. Sometimes with concrete, how do you use living organisms to biomineralize so that you leverage off their existing skills and imagine them into new contexts so not only to reproduce concrete that we make for buildings, but concrete is a new material that can be used in other contexts. I'll show you how it works in the future. And then how do we think about plastic, not only as plastic that is only in bottles, but plastic that has new kinds of applications, not only something that we like to, it's like a horror case, everyone on the planet wants to get rid of plastic, but what does it mean to reimagine plastic when it eats itself, when its tasks are done, when it needs to become a packaging material, it inflates itself, and when it needs to disappear, it disappears by itself. So instead of fielding the guilt, how do we design the materials into new design concepts? So as designers, we are also not interested in thinking about materials, but materials always in application in other products, in our lives as different applications or in different contexts where they really bring a lot of value. So plastics are bad in a packaging context, but maybe plastics can be reinvented in with biology for different applications. So this is a work that Hyun mentioned that we did with Design Lab a couple of years ago, we did collaboration with Puma. Let me show you a little bit about how biology can be actually embedded into packaging. So when we think about interfaces, we always think about humans interacting with the live organisms, humans interacting with information, humans interacting with the physical world, but we also can design interfaces for live organisms. So organisms interacting with materials and their environment. So interface design can actually be something that we can program where the organisms start to degrade the material, start to produce the material, start to make the carbon dioxide that inflate the material so that you can see the packaging taking the shape of the shoe. And then when the organisms are done, they start, when the packaging's rolled is done, the organisms start to degrade the material itself. So as you can see, there are a lot of design considerations that are in place, the packaging, the size, how long the packaging needs to live and how actually we can get rid of it when it's done. But to bring you back to the context of the interface related to humans, not only interfaces between living organisms and the body and other materials, what does it mean to think about these new biointerfaces on ourselves? So we have seen tattoos on our body that are imagined by researchers here, but not everyone is interested in like embedding biosensors onto the skin, right? So we have to come up with new ways to encapsulate, contain the organisms inside different media so that we can interface them with our bodies in a comfortable way. So maybe they should be optional so that when we don't need them, when we need them to sense something, we can attach them to ourselves and we don't want need time, we should be able to remove them. So interfaces can become maybe single use, one time only, and on demand when we need to. So you're looking at a video where the person is putting the stickers that have the organisms inside them, which respond to the carbon dioxide. When there's pollution, they change color. You get instant feedback, and when you're done with your run, you can take them off and recycle them. So some of this work is also outside. I'll point you to this. So I brought the examples. You can see the living materials themselves in design context so that we can have a conversation around them. What does it mean to design with them and what kind of other forms that you can bring? So just to pay a little attention to this, where do I see I can make a contribution to this community is, as a designer, I think a lot about what does it mean to bring, to think about the relationship between organisms and different materials? Because when you have a living organism that you need to keep alive, feed, and protect it from other species around so that they don't cause containment, you have to think about how do I embed them into the materials? So you have seen the nice little sticker, but before we arrived to the sticker, we tested all kinds of different materials where maybe some of macro paper, microfluidics could actually be used for encapsulating these organisms for different form factors, for different applications. So designer's role is always about prototyping, iterating with new materials so that we can find new context for the science that we are learning in this room. So these are very quick and dirty prototypes, but this shows you the challenge of how do you move from the liquid design space of life to the three-dimensional physical product space that we consume in our everyday lives. So it's not easy to take the liquids, prevent them to dry, feed the organisms, and keep them healthy and safe, not only for our safety, but their own safety in applications. So a lot of work takes place when you take the biology from the lab into the design studio to try to keep them in a contained form. I'm going through a couple of examples. There's never a right form. The design of the form is always in negotiation with the experience of the users, how costly it is to produce it. When you write the paper and publish in a journal, the work is done, but if you wanna scale things up, you need recipes, you need repeatable solutions so that manufacturers can produce them. So how do we arrive to this? I love the organoids solution from the previous presentation. So these are the organoids that I made in the kitchen using kitchen level equipment with home-grade organisms, they are not living, but as you can see in these little bubbles, you have live organisms that can actually come together and form new materials, and when you impose them to light, they can break down and become disposable. How do you do this in your kitchen as opposed to a very resourceful lab? Is my important research question. So I'll show you one more detailed project and I will stop. How do you bring, how do we grow not only the organisms, the interfaces, but also to grow the different kinds of interactions to the, and embed them into the lifespan of a product? Because when we think about interfaces or physical products, we always assume that they live forever, but biology doesn't live forever. So you either need to renew it, our bodies constantly renew their cells, but when we think about interfaces, we don't think about them renewable. We don't think about them changeable and active. Biology does that, but in our product design, we have to accommodate that one minute sign. So very quickly, this is a paper furniture that we designed at Pratt University in New York together. This is made of paper that is going through a particular process called vulcanization. We embed different kinds of hydrogels onto the surface of the paper so that we can embed different organisms in different layers so that we can bring different kinds of qualities to it so you live different in the environment, they can detect things from the environment as biosensors, but also things that can change in terms of style, aesthetics, and texture. Because design is not only about just finding a function that is in terms of a known utility, but in terms of style and how it finds a place in people's values whether in different social classes, cultures, and so on. So we did a lot of experimentation with a tool that you can see outside, which is a portable bioreactor that I hope will make biology more accessible to designers who doesn't have the tools and the means to explore and prototype the things. Here's a little video of how it works. For example, you bring it, you wanna test how an organism grows, how a biofilm forms on a different material. You actually put it inside these, let me play the video, you can put it inside these disposable vessels, put your cultures in, grow them and image them and sense them while they're growing so you can really record the recipe of which organism under which conditions really interact with this material. This information is very crucial if you really wanna push into design applications because otherwise the information that you can read from a paper, scientific paper, will be very difficult to reproduce. So we can talk about this for hours about what does it mean for designers to really reproduce scientific work. I will show you a couple of more images of how different experimentations can be made, how organisms not only respond to the outside environment, but also the curvature of a material, the humidity of a material, how they stick around, how long do they last? Like we never think about interfaces in terms of duration, but all biologists, time-based and durational. So what does it mean for designing durational interfaces? So I will show a couple of more slides. You will see the objects at the end, but I'll leave you with this slide because these are conversation points for the afternoon. Which organisms we pick? How do we embed them into different materials? What does it mean to design the life cycle of a product? Like when the living organisms inside, what is how long do they need to live? How soon they need to be done so that you can think about the afterlife of product whether it's decomposing it or upcycling it into a new product as an ingredient. So I'll stop here and thank you very much for listening.


Hello everybody. My name is Yordanka Rajov. I work for the VMware open-source technology center and in this talk I'm going to show you how to write plugins for KernelShark. Before we start, I want to say a few words about this talk. Our original idea was to make a tutorial, but because of the current situation with the conference being online, we decided to switch to a regular talk. But so this is something I'm calling quasi-tutorial. You see a lot of quotes. You're not supposed to try running this quote during the presentation online, but the examples will be available together with my slides and you can download it and try it and we'll be very, very happy to help you if you have questions offline. With that being said, let's move to the actual talk. So we assume that you are a KernelShark user already or at least that you know something about KernelShark and you are interested in using it. For this talk, we have one main goal, which is to teach you how to customize the KernelShark GUI by using the KernelShark libraries and we have something which is like a bonus goal for us, which is to actually show you that you can use the library without using the GUI. So let's see if this will be successful. Before we start, let's see some very basic definitions in one extremely simple example. How do we access the data with the KernelShark libraries? So in this tutorial, I will assume that you have a Ftrace data recorded with Trace-CMD. In principle, KernelShark can open arbitrary data format, but this is outside of the scope of this talk. So for the moment, we assume that you have a trace file recorded with Trace-CMD and you want to open it. So in your file, you may have a million of tracing records, very different event types, hundreds of different event types. Each event type has specific data being recorded in it, different data fields. But not all of this data is actually used directly by the visualization. In case-shark entry, that's the basic data unit that we use in KernelShark. It's a structure which holds only the absolute minimum of information from each trace record that is needed in order to visualize. Because we show kind of time series of trace records, of course, we need the time of the record. We also need the CPU core, the idea of the CPU core on which the record happened. We need the process idea of the task this record belongs to. We need the kind of identifier of the event type. And basically, that's more or less everything that we need. Of course, there is more data being recorded and we need to have a way to access this data. So this can happen on demand when you need it via the offset in the file of the actual original record which corresponds to this entry. And now let's see how we can use this in a very simple example. So how can you open a data file with library? You first initialize the context of the session, then you open the file.  So I assume that your trace file is called trace.dat in the same directory. But you have to make this more sophisticated. So you check if the file was successfully opened. Then you load the data into this array of k-shark entries. If this operation is successful, you can loop over the entries. And for example, plot things like the CPU core process ID, the time of the record. The important thing here is that after you load the data, all k-shark entries are sorted in time. Which means that when you do a loop like this, you will see the time of the records progressing. That's important. We will see why later. And so let's say that you are interested, for example, in sketch switch events and you want to check what is the next priority when you do a context switch. So you can check if the event ID of the k-shark entry is the same as the event ID of the sketch switch. And if this is the case, you can use the offset of the, which is inside the entry to retrieve the value of the next priority for this particular event. Be aware that this is a relatively expensive operation. So if you want to do this for a small fraction of the events, that's okay.  And you will see that there are actually clever ways to do this later in the presentation. Of course at the end, you have to free all the resources that have been allocated, but this is trivial. And so far so good. We are able to print the data to the screen, but other tools can do the same. And this is not interesting at all. We want to see how we can visualize data, not to print it to the terminal. Before trying to visualize something, we have to understand the way the visualization model used by Kernel-Shark works. Back to our case when we have a huge file containing a lot of records. And let's say that you have this file opening Kernel-Shark. You've been zooming in, zooming out, scrolling here and there. And at some point you visualize only as a fraction of the tracing data that has been recorded. And let's say that you are visualizing everything that is inside a time window, which here is called t. So you are somewhere in the file and you visualize part of it. And it's within this time interval. The way we visualize this is to actually subdivide this big time interval t into smaller, uniformly sized intervals, which we call bins, or we can call it bucket if you want. It's pretty much like a histogram. And when you want to visualize something, you only check what is going on at the beginning of the bin and at the end of the bin. Everything that is in between gets ignored. Remember that when we loaded the data, it was sorted in time. So in order to determine the state of the model, the only thing that you really need is to know the index of the first event in a given bin and the index of the first event in the next bin. So everything that is in between will belong to the bin we are looking for. Okay, this was the explanation of the model. The diagrams, they look cool, but let's see some code. So back to the simple example from the very beginning. We open the file. We load the data into this array of kernel shark entries. Up to here, everything is the same as in the example before. So now we initialize the model here. The model is called histo. So we initialize the model. We set the binning because we want to keep everything as simple as possible for the moment. We'll get a very simple model which has only five bins. And the range of the model will start from the time of the very first record and will continue up to the time of the very last record. So this basically means that we will visualize everything. And now the state of the model is determined. So now we can fill the model with data. This is happening here in this fill function. And at that point, the model is ready to be used. So how can we use the model? We said that we want to see what is going on at the beginning of the bin and at the end of the bin. So we'll first ask the model, okay fine for me the first entry which has this value of the CPU ID. So we were looking for first data from CPU Core 2. And we want this to be in bin number 3 for example. And so we call this callback function match CPU. So this will return for you the very first kshr entry from CPU 2 in bin 3. And from the entry you can retrieve actually the task name. So this is the name of the task that correspond to the process ID which is recorded inside the entry. You can do the very same thing with the last entry in this bin. And here again you can plot okay this is bin 3. It starts with this task that has this process ID. And the same bin ends with another task probably which has a different process ID. Okay so far so good but this is still printing something to the terminal which is not what we want. And I guess it sounds too abstract to understand what is really going on. Here is actually seeing kernel shark visualizing something. So of course here the number of bins is not equal to five. What we do is the most natural one. So we just check what is the total number of horizontal pixels available for drawing. And then we set the number of bins to be equal to the number of pixels available. So basically one bin is one pixel. And here you see a really huge data file open in kernel shark.  And so if you click somewhere on this graph the marker will select the very first entry in the bin or pixel that has been clicked. In this case you see marker A has something being selected. Just imagine that you switch to marker B and somehow you managed to click to the very next bin that is exactly next to the one which you clicked before. So in this case you're not going to select the next event. You're going to select the first event in the next bin which will actually be thousands of events distant from the one which you selected with marker A. So this is one extreme case of the visualization model when you have thousands of events in each bin. But let's see the other extreme which is when you do a very very deep zoom. In this case the time interval which is being visualized is much much smaller. That's why you see much less events. And so here with each vertical tick that you see in the graph corresponds to one bin. And the place where you see no ticks these are bins which are empty. They contain no data. So most of the bins in this case are empty. And you have some bins containing just one entry.  And then if you click to the next tick you select the next entry. You see the text of the next record showing up in the table. So these are the two extreme states of the model and of course it can be in any state in between those. That depends from you. If you zoom in you go deeper. If you zoom out you see a broader view. Okay. So this I hope with this you understand the way the model works. But this is the built-in model. So that's the the visualization that comes out of the box. That's not what we want to actually learn from this talk. So let's see how we can customize Kernel Shark. And let's start with the equivalent of the Hello World program which is the Hello World plugin. So this is the customization that you want to inject inside the GUI. So you want the GUI to print Hello World. That's your callback function which you attach to the the code of the GUI. So how can you make this thing a Kernel Shark plugin? Basically what you have to do is just to build this code as a shared library. And inside this shared library you have to provide those two methods the initializer of the plugin and the initializer of the plugin. And inside the body of the initializer you have to register your callback function and you have to unregister it in the day initializer. It's as simple as this. So if you build this and you open this plugin in Kernel Shark what will happen is that you if you start Kernel Shark from terminal you see Hello World every time when you you change something in the graph for that when you zoom in here zoom out or any time when you change something you will see this thing being printed and actually you see it printed two times because in this particular example you have two graphs being shown by the GUI currently. So you see this thing printed once per each graph. Again this is completely useless but it's just a starting point to explain you how you can write a plugin. Okay so let's do something which is still completely useless but it's at least a little bit more interesting. Let's instead of printing Hello World to the terminal let's draw Hello World inside the visualization area of the GUI. So how can we do this? That's the modification that you have to do again because I want everything to fit to a single slide. Some things are hard-coded here for example the font file is hard-coded but together with my slides I will plot the code of the example. So there you can see how this can be done in a more appropriate way. So what do we do here? We just load the font here in this get font function and inside the body of your callback function we call this routine print text. We provide the font. The color is no which means it will be plotted or drawn in black. Here we give the coordinates and that's the text that we want to see. And if we build such a plugin and if we load the plugin with Kernel Shark we will see this. You see the Hello World in the middle of your graphs. The important thing here so this text is absolutely static. No matter what you do you can zoom in zoom out it always stays there unchanged and that's because this plugin knows absolutely nothing about the data that is being visualized together with the Hello World text. So again this is completely useless. This can't help you solve your tracing problem but it's a good step to learn. Now let's try to implement another plugin which this time will know something about the data which is currently being visualized. So this time you have to implement a different initializer. So in the initializer you will register something which is called event handler. So the previous time we registered the draw handler this time we will register an event handler and that's the user action which we want to inject into the original plotting algorithms used by Kernel Shark. So this action will be executed when you load the data. So you register a callback for a specific event. In this case it is for this event ID which corresponds again to the sketch switch event. That's how you retrieve the ID of the sketch switch event. So you register this pluggable action for this event and inside your pluggable callback you first retrieve the value of the next priority. So this time this is a different operation. Here you don't use offset to jump up and down in the file because you already have the record in the memory by the time when this callback is executed. So this is much faster actually. So you directly retrieve the particular field in the tracing record you are interested in next priority and you can fill this information into something which you call data container. So for each if you have a plugin like this for each sketch event you have an entry in the data container you initialize data container here in the initializer of the plugin. I have no place on the slide to show the initializer but basically here you have to free the memory of the container and you have to unregister the callback and that's it. So this plugin is as simple as this and at the end with this plugin you will be able to know all the next priority values of all sketch switch events inside your trace file. There is nothing magical about this plugin and I want to show that you can do exactly the same with the very basic example from the beginning of my presentation. Let's see how this can be done in the example. Again everything here is the same up to this point where we open the file. Here we initialize the data container then we have to find the stream object which corresponds to the trace dot dot file. With this stream object we can retrieve the event idea the sketch switch event and now we will register the event handler with the callback. So the callback function is the same I'm not showing it here because I don't have a place on the slide and below everything once you load the data you can do the following. So instead of looping over all the data you can only loop over the entries inside the data container so be aware that this data container is not going to be sorted that's because the data doesn't show sorted in the file but you can sort it this is optional it depends it's up to you if you want the data to be sorted you can sort the container and now you can print the same thing CPU ID process ID time from the container and you can get also the next priority and as I said printing is not very useful but you can use the very same mechanisms in your plugin. Okay so far so good we know how to draw from a plugin we know how to access data from a plugin let's make a plugin that can do both. This time for this plugin I will use C++ for the drawing callback just because the GUI itself is written in C++ so written making the callback developed in C++ makes the integration easier in principle this will be also variable in C if you don't like C++ it will be possible to implement a drawing callback like this in C this is not fully functional yet but it will be available so let's try to understand what is going on inside to this call drawing callback function so first of all we convert the C arguments of the function into C++ objects then because so we want to plot to see to visualize how the priority changes when we do context switch on a CPU so how the CPU switches between different priorities that's why we want this thing to be plotted only on top of CPU graphs if this is not a CPU graph then your callback will just do nothing we'll return then we are trying to check if we have a data container for this particular data stream and if we don't again we return this part here needs a little bit of extra explanation if you remember the discussion we have in the case when you open a huge data file and you have thousands of events in each bin it may happen that you have multiple sketch switch events in a single bin or you can have a sketch switching almost every bin in your histogram then the different bins will try to plot different things on top of each other which will result in a kind of ugly situation there are actually things you can do to solve this you can make your plotting logic a little bit more sophisticated but again this is hard to fit on a single slide so here I would just say okay don't do anything if this is not a deep zoom if you have too many events being visualized at the same time just ignore and here is the actual routine which is used to plot your elements on top of the graph you can write your own loop which does this it's not going to be something very complicated actually it's very simple but instead you can use also some of the routines which are coming together with the library in this case we have very simple needs so we just want to plot one data field from one particular event so we will use the most basic routine that is available which is event field plot min so why it's min because as I mentioned you can have multiple sketch switches in the same bin of the model and in this case if you want to see only the high priority tasks you need the next priority to be a smaller number so if you have multiple sketch switches in a single bin you want to visualize only the one that has higher priority or smaller value of next priority as a number okay so let's see what we do in this routine we first provide the the arguments so here you have from here from this arc cpp object you can retrieve all the coordinates of the graph that is under the plotting that you want to do then you provide your data that's the data container you provide this check callback function which in this case is just a simple c++1 the function which does one very simple check so you know that this will be plotted on top of a cpu graph and so you want to only care about the entries which have the same cpu id so you don't care about sketch switches and other cpus so you only want to visualize the sketch switches of the cpu which is currently plotted under the the region which the plugin now tried to draw something on top of course you can make a more complicated logic here for example let's say you really want to see only very high priority tasks so you can say okay I want next priority to be below a certain threshold for example you can add this logic into this callback function and this will do the job for you and there is another callback which you have to raise so this is the make shape callback we will see the implementation of this thing just in a minute and you provide the the color of the shape that you want to plot and its size so here is the implementation of the actual drawing again because this is the most simple possible example you are actually plotting only one data field of one particular tracing event and you don't care about things like correlating different events between different graphs so you still do the very basic thing so in this case you in this function you receive only one graph only one bin number inside this graph only one data field and you receive the color and the size you can retrieve the coordinates of the the bin on top of which you want to plot something over the graph and with this coordinates you create a text box object you have to provide the font you convert your integer value into string you provide you give the color you ignore the size because the text box the text box doesn't care about the size and you just say okay these are the coordinates of the text please draw the text here okay now we can do demo so here you see the plugin here let's first clean everything okay we'll rebuild the plugin you just need to provide the the path to the libk shark includes okay so we have the plugin now let's open kernel shark with this plugin so we will load the plugin directly from the command line you can do this from the menu of the GUI but this way it's faster so we do okay and we'll open one trace file I hope you can see this on your screens I hope it's not too small okay so you see nothing because as already explained you the plugin will only work if you do a deep zoom so let's select something and zoom in so you can see the the priority being plotted on top of every sketch switch event unfortunately there is nothing really interesting here let's try to find something which has higher priority and here it is so here you see tasks with different priority switching switching out for example if you click here you see that the post audio task is switching in and it has priority 109 and you see this thing actually being visualized on your graph okay so just to demonstrate for you that this is there's nothing magical happening here and this is the very same code that you saw in the presentation so we do so what what do we have here so that's the the get font function which is used to load the font well what is different here is on the in the example given in the presentation I assume that you already that you have only one file being open we can open multiple files so then you you need to have a one data container for each data stream so instead of having a single data container we have an array of data containers now here is the processing callback it's it's the same so you just add to the data container which corresponds to your stream here is here you can see how how is the what is the proper way to actually find the the font file not to have it hard-coded you initialize the container here you register the two callback functions here you unregister you free the memory of the container and that's it okay now let's open the the callback function that is used for plotting again it's exactly the same as the one I showed you in the presentation here is the make shape function and here is how you registered how you you run the the plotting routine okay so going back to the presentation what else can be done with plugins one you think which is possible with plugins with kernel shark 2 is that plugins can add clickable shapes here you see a visualization of the plugin which was already available in kernel shark one the visualization of the latency between sketch switch between sketch waking and sketch switch event you you probably know this so this was visualized with this small green box plotted before the actual start of the task now if you click on the the latency box this will automatically select for you the sketch waking and sketch switch event how can you implement something like this it's very simple you just have to make your custom plotting object which in this code in this case is called the latency box it inherits the rectangle object and in your customized plotting object you just have to implement the interface which is made of two functions double click and distance in the double click you just implement what you want to do here it's it's very simple as you see you just say okay I want to select with marker a the first entry which is the sketch waking event and with marker b the second entry and the next thing you have to implement is this distance functions distance function so the GUI uses this thing to decide if your click is close enough to the object or it's too far and it's not going to execute the double click in this particular case this function returns zero if you click inside the latency box and infinity if you click outside which means that you really have to click inside the box in order to select something the plugins can now register additional menus for example you here you can see the menu of a more generic version of the plugin that we just implemented this generic function can plot any field of any event so here you see from the menu we are actually selecting the same thing we are selecting the sketch switch event we are selecting the next priority field I hope you can see this and we are selecting that we are interested in seeing the minimum values so once you click apply yeah this is probably too small for you to see it but so on top of each sketch switch event you see a small dot or a small line being plotted and for example you see this line is kind of bigger which means that you have a high priority task here in every place in all places where you see just a dot means a low priority task okay how can you implement this it's again very simple you just have to provide another in plugin initializer in the implementation of your plugin and in the case which I show you you saw on the previous slide it's as simple as this you inside this menu plugin initializer you just create your the widget of your new dialogue of course you need to provide implementation of the widget and then you say okay I want to register this menu the name of the menu will be plot event field and I want to register this into the tools menu so you basically say okay uh my the name of my menu is tools slash uh plot event field and you you say to the GUI the chrono char GUI add plugin menu with this name and that's it it's as simple as this if you don't in this particular case it uses a qt defined widget but if you want to have something different you can implement whatever you want it it will just start in a new window so it doesn't need to be to read to be a qt object plugins can be used also to load data that has arbitrary format for us this is very interesting but unfortunately it goes out of the scope of this talk but if you are interested in opening your own data with a specific format that you have in kernel shark please contact us and we will show you how you can write a plugin which will make this possible so we'll be able to open your data together with the ftrace data for example or with uh I mean you can mix whatever data formats you want and open all this together merged inside the GUI with the help of a plugin uh we started the upstreaming process of the kernel shark to to kernel dot org uh we are right now in the middle of the code review or maybe in the first half of the of it let's say uh this process will take some time because steven rosted our team lead is very busy with other tasks but I guess in couple of months the we will release the kernel shark 2.0 at the kernel dot org uh at the same time a beta version is available uh here on this github repo but yeah please keep in mind that because we are reviewing the code right now uh this branch here will uh be rebased probably several times at least so if you want to use this right now you can download it from github uh but the final version will be uh will be available on kernel dot org uh we hope this tutorial was useful if you have ideas for plugins that can help you solve the particular problems that you have please give it a try and as I said we'll be very happy to help you in case you have difficulties implementing your plugin you can contact me my email is on the title slide or we can contact steven rosted it's uh the same thank you very much if you have questions please