This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/include/seastar/core/internal/pollable_fd.hh | |
+++ b/include/seastar/core/internal/pollable_fd.hh | |
@@ -57,6 +57,7 @@ class pollable_fd_state { | |
int events_requested = 0; // wanted by pollin/pollout promises | |
int events_epoll = 0; // installed in epoll | |
int events_known = 0; // returned from epoll | |
+ bool is_acceptor = false; // put acceptor to disinct epoll | |
promise<> pollin; | |
promise<> pollout; | |
friend class reactor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/src/core/reactor.cc | |
+++ b/src/core/reactor.cc | |
@@ -124,6 +124,12 @@ | |
#include <typeinfo> | |
#endif | |
+namespace { | |
+ thread_local static int schedule_count = 0; | |
+ thread_local static int schedule_urgent_count = 0; | |
+ thread_local static int epoll_count = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A cpu profiler used to find out hot functions | |
// modified from https://github.com/jitbit/cpu-analyzer | |
// require nuget package: | |
// https://www.nuget.org/packages/Microsoft.Samples.Debugging.CorApi | |
// https://www.nuget.org/packages/Microsoft.Samples.Debugging.MdbgEngine | |
// | |
// Copyright 2012 - Sam Saffron | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
# todo: | |
# - train bias | |
# - increase alpha when learning progress is slow | |
# - fix bugs | |
# - produce nan when weights_expected are all 0 | |
np.random.seed(1) | |
np.set_printoptions(suppress=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
using System.Reflection; | |
using System.Runtime.CompilerServices; | |
namespace ConsoleApp1 | |
{ | |
public class Program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.intel_syntax noprefix | |
.data | |
hello_string: | |
.ascii "Hello World!\n" | |
len: | |
.long len-hello_string | |
.text | |
.global main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// g++ ptrace_child.cpp -o ptrace_child && ./ptrace_child | |
#include <unistd.h> | |
#include <iostream> | |
#include <chrono> | |
#include <thread> | |
void testAAA() { | |
std::cout << "testaaa" << std::endl; | |
std::this_thread::sleep_for(std::chrono::seconds(1)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <memory> | |
#include <atomic> | |
namespace { | |
class AImpl { | |
public: | |
void test() { ++value; } | |
std::atomic_int value; | |
}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install windbg from: | |
http://msdn.microsoft.com/windows/hardware/hh852362 | |
Execute windbg, select File => Open Executable, | |
choose C:\Program Files\dotnet\dotnet.exe and use "c:\path\to\application.dll" as arguments (don't forget the double quotes if path contains space). | |
Use commands: | |
sxe ld clr | |
g | |
.loadby sos coreclr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sudo apt-get install liblttng-ctl-dev | |
// g++ -Wall -Wextra --std=c++11 CaptureLttngEventFromCoreClr.cpp -llttng-ctl && ./a.out | |
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
// ! ! | |
// ! Don't copy this code to your project, ! | |
// ! it contains GPL licensed code from lttng-tools (lttng-viewer-abi.h).! | |
// ! ! | |
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
#include <lttng/lttng.h> | |
#include <sys/socket.h> |
NewerOlder